From: keith.busch@intel.com (Keith Busch) Date: Thu, 8 Aug 2013 10:25:38 -0600 Subject: [PATCH 2/2] NVMe: Disk stats for read/write commands only In-Reply-To: <1375979138-17472-1-git-send-email-keith.busch@intel.com> References: <1375979138-17472-1-git-send-email-keith.busch@intel.com> Message-ID: <1375979138-17472-2-git-send-email-keith.busch@intel.com> Flush and discard requests would previously mess up the accounting. Signed-off-by: Keith Busch --- drivers/block/nvme-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 56d1fa4..8fa76c2 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c @@ -342,11 +342,11 @@ static void bio_completion(struct nvme_dev *dev, void *ctx, struct bio *bio = iod->private; 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, 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); if (status) bio_endio(bio, -EIO); -- 1.7.10.4