summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/blk.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2015-05-16 12:28:53 -0400
committerDan Williams <dan.j.williams@intel.com>2015-06-26 11:23:38 -0400
commitf0dc089ce217e7b98e0d2077c548ff08129e7911 (patch)
treec1cd5a098b2ada1f55134fd1c59ad94263cf37ac /drivers/nvdimm/blk.c
parentedc870e54696beb9f3835ecb41a4e1c84ee4584d (diff)
libnvdimm: enable iostat
This is disabled by default as the overhead is prohibitive, but if the user takes the action to turn it on we'll oblige. Reviewed-by: Vishal Verma <vishal.l.verma@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/blk.c')
-rw-r--r--drivers/nvdimm/blk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/nvdimm/blk.c b/drivers/nvdimm/blk.c
index 5c44e067652f..96ef38ceeceb 100644
--- a/drivers/nvdimm/blk.c
+++ b/drivers/nvdimm/blk.c
@@ -168,8 +168,10 @@ static void nd_blk_make_request(struct request_queue *q, struct bio *bio)
struct bio_integrity_payload *bip;
struct nd_blk_device *blk_dev;
struct bvec_iter iter;
+ unsigned long start;
struct bio_vec bvec;
int err = 0, rw;
+ bool do_acct;
/*
* bio_integrity_enabled also checks if the bio already has an
@@ -185,6 +187,7 @@ static void nd_blk_make_request(struct request_queue *q, struct bio *bio)
bip = bio_integrity(bio);
blk_dev = disk->private_data;
rw = bio_data_dir(bio);
+ do_acct = nd_iostat_start(bio, &start);
bio_for_each_segment(bvec, bio, iter) {
unsigned int len = bvec.bv_len;
@@ -196,9 +199,11 @@ static void nd_blk_make_request(struct request_queue *q, struct bio *bio)
"io error in %s sector %lld, len %d,\n",
(rw == READ) ? "READ" : "WRITE",
(unsigned long long) iter.bi_sector, len);
- goto out;
+ break;
}
}
+ if (do_acct)
+ nd_iostat_end(bio, start);
out:
bio_endio(bio, err);