summaryrefslogtreecommitdiffstats
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorGu Zheng2014-11-24 04:05:22 +0100
committerJens Axboe2014-11-24 16:04:44 +0100
commit394ffa503bc40e32d7f54a9b817264e81ce131b4 (patch)
tree551aa110ea3ef7519d7a5ea444ac9c9640de4234 /include/linux/bio.h
parentblk-mq: handle the single queue case in blk_mq_hctx_next_cpu (diff)
downloadkernel-qcow2-linux-394ffa503bc40e32d7f54a9b817264e81ce131b4.tar.gz
kernel-qcow2-linux-394ffa503bc40e32d7f54a9b817264e81ce131b4.tar.xz
kernel-qcow2-linux-394ffa503bc40e32d7f54a9b817264e81ce131b4.zip
blk: introduce generic io stat accounting help function
Many block drivers accounting io stat based on bio (e.g. NVMe...), the blk_account_io_start/end() which is based on request does not make sense to them, so here we introduce the similar help function named generic_start/end_io_acct base on raw sectors, and it can simplify some driver's open io accounting code. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 7347f486ceca..efead0b532c4 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -443,6 +443,11 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
extern void bio_set_pages_dirty(struct bio *bio);
extern void bio_check_pages_dirty(struct bio *bio);
+void generic_start_io_acct(int rw, unsigned long sectors,
+ struct hd_struct *part);
+void generic_end_io_acct(int rw, struct hd_struct *part,
+ unsigned long start_time);
+
#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
#endif