提交 b15c592d 编写于 作者: C Christoph Hellwig

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: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NKeith Busch <keith.busch@intel.com>
Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
Reviewed-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
上级 7fe07d14
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册