Signed-off-by: Pavel Begunkov <[email protected]>
---
 drivers/nvme/host/pci.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 651f7654d73b..79b3c1092e4d 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1287,16 +1287,15 @@ static blk_status_t nvme_rq_setup_dmabuf_sgl(struct 
request *req,
                struct nvme_queue *nvmeq, unsigned int entries)
 {
        struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
-       struct bio *bio = req->bio;
-       struct nvme_dmabuf_map *map = to_nvme_dmabuf_map(bio->bi_dmabuf_map);
+       struct nvme_dmabuf_map *map = nvme_req_to_map(req);
        size_t length = blk_rq_payload_bytes(req);
        struct nvme_sgl_desc *sg_list = &iod->cmd.common.dptr.sgl;
+       size_t offset = req->bio->bi_iter.bi_offset;
        bool pooled = entries > 1;
        dma_addr_t sgl_dma = 0;
        unsigned int mapped = 0;
        unsigned long tmp;
        struct scatterlist *sg;
-       size_t offset = bio->bi_iter.bi_offset;
        size_t remaining = length;
 
        if (!entries)
@@ -1305,8 +1304,6 @@ static blk_status_t nvme_rq_setup_dmabuf_sgl(struct 
request *req,
        iod->cmd.common.flags = NVME_CMD_SGL_METABUF;
        iod->total_len = length;
 
-       nvme_dmabuf_map_sync_for_device(nvmeq->dev, req);
-
        /* entries == 1 fits in the inline descriptor; more needs a pool. */
        if (pooled) {
                if (entries <= NVME_SMALL_POOL_SIZE / sizeof(*sg_list))
-- 
2.54.0


Reply via email to