Skip to content

Commit

Permalink
nvme-pci: only call nvme_unmap_data for requests transferring data
Browse files Browse the repository at this point in the history
This mirrors how nvme_map_pci is called and will allow simplifying some
checks in nvme_unmap_pci later on.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
  • Loading branch information
Christoph Hellwig committed Apr 5, 2019
1 parent 7fe07d1 commit b15c592
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,8 @@ static void nvme_pci_complete_rq(struct request *req)
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);

nvme_cleanup_cmd(req);
nvme_unmap_data(iod->nvmeq->dev, req);
if (blk_rq_nr_phys_segments(req))
nvme_unmap_data(iod->nvmeq->dev, req);
nvme_complete_rq(req);
}

Expand Down

0 comments on commit b15c592

Please sign in to comment.