Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b15c592d authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

nvme-pci: only call nvme_unmap_data for requests transferring data



This mirrors how nvme_map_pci is called and will allow simplifying some
checks in nvme_unmap_pci later on.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
parent 7fe07d14
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -929,6 +929,7 @@ static void nvme_pci_complete_rq(struct request *req)
	struct nvme_iod *iod = blk_mq_rq_to_pdu(req);

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