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

Commit 9e59d091 authored by Keith Busch's avatar Keith Busch Committed by Matthew Wilcox
Browse files

NVMe: Disk stats for read/write commands only



Flush and discard requests would previously mess up the accounting.

Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
parent 7e03b124
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -342,11 +342,11 @@ static void bio_completion(struct nvme_dev *dev, void *ctx,
	struct bio *bio = iod->private;
	struct bio *bio = iod->private;
	u16 status = le16_to_cpup(&cqe->status) >> 1;
	u16 status = le16_to_cpup(&cqe->status) >> 1;


	if (iod->nents)
	if (iod->nents) {
		dma_unmap_sg(&dev->pci_dev->dev, iod->sg, iod->nents,
		dma_unmap_sg(&dev->pci_dev->dev, iod->sg, iod->nents,
			bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
			bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);

		nvme_end_io_acct(bio, iod->start_time);
		nvme_end_io_acct(bio, iod->start_time);
	}
	nvme_free_iod(dev, iod);
	nvme_free_iod(dev, iod);
	if (status)
	if (status)
		bio_endio(bio, -EIO);
		bio_endio(bio, -EIO);