diff options
author | Dan Williams <dan.j.williams@intel.com> | 2015-05-16 19:28:53 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-06-26 18:23:38 +0300 |
commit | f0dc089ce217e7b98e0d2077c548ff08129e7911 (patch) | |
tree | c1cd5a098b2ada1f55134fd1c59ad94263cf37ac /drivers/nvdimm/pmem.c | |
parent | edc870e54696beb9f3835ecb41a4e1c84ee4584d (diff) | |
download | linux-f0dc089ce217e7b98e0d2077c548ff08129e7911.tar.xz |
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/pmem.c')
-rw-r--r-- | drivers/nvdimm/pmem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index e846a627ebdf..09195e3b7453 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -58,14 +58,19 @@ static void pmem_do_bvec(struct pmem_device *pmem, struct page *page, static void pmem_make_request(struct request_queue *q, struct bio *bio) { + bool do_acct; + unsigned long start; struct bio_vec bvec; struct bvec_iter iter; struct block_device *bdev = bio->bi_bdev; struct pmem_device *pmem = bdev->bd_disk->private_data; + do_acct = nd_iostat_start(bio, &start); bio_for_each_segment(bvec, bio, iter) pmem_do_bvec(pmem, bvec.bv_page, bvec.bv_len, bvec.bv_offset, bio_data_dir(bio), iter.bi_sector); + if (do_acct) + nd_iostat_end(bio, start); bio_endio(bio, 0); } |