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

Commit 915f04c9 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

nvme-pci: move the call to nvme_cleanup_cmd out of nvme_unmap_data



Cleaning up the command setup isn't related to unmapping data, and
disentangling them will simplify error handling a bit down the road.

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 9b048119
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -888,7 +888,6 @@ static void nvme_unmap_data(struct nvme_dev *dev, struct request *req)
			dma_unmap_sg(dev->dev, &iod->meta_sg, 1, dma_dir);
	}

	nvme_cleanup_cmd(req);
	nvme_free_iod(dev, req);
}

@@ -939,6 +938,7 @@ 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);
	nvme_complete_rq(req);
}