diff options
author | Dan Williams <dan.j.williams@intel.com> | 2015-05-16 12:28:53 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-06-26 11:23:38 -0400 |
commit | f0dc089ce217e7b98e0d2077c548ff08129e7911 (patch) | |
tree | c1cd5a098b2ada1f55134fd1c59ad94263cf37ac /drivers/nvdimm/nd.h | |
parent | edc870e54696beb9f3835ecb41a4e1c84ee4584d (diff) | |
download | linux-f0dc089ce217e7b98e0d2077c548ff08129e7911.tar.bz2 |
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/nd.h')
-rw-r--r-- | drivers/nvdimm/nd.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index 6f916b65b7d6..4614b00542d1 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -13,6 +13,7 @@ #ifndef __ND_H__ #define __ND_H__ #include <linux/libnvdimm.h> +#include <linux/blkdev.h> #include <linux/device.h> #include <linux/mutex.h> #include <linux/ndctl.h> @@ -202,5 +203,17 @@ int nvdimm_namespace_detach_btt(struct nd_namespace_common *ndns); const char *nvdimm_namespace_disk_name(struct nd_namespace_common *ndns, char *name); int nd_blk_region_init(struct nd_region *nd_region); +void __nd_iostat_start(struct bio *bio, unsigned long *start); +static inline bool nd_iostat_start(struct bio *bio, unsigned long *start) +{ + struct gendisk *disk = bio->bi_bdev->bd_disk; + + if (!blk_queue_io_stat(disk->queue)) + return false; + + __nd_iostat_start(bio, start); + return true; +} +void nd_iostat_end(struct bio *bio, unsigned long start); resource_size_t nd_namespace_blk_validate(struct nd_namespace_blk *nsblk); #endif /* __ND_H__ */ |