OSDN Git Service

block: add disk/bio-based accounting helpers
authorChristoph Hellwig <hch@lst.de>
Wed, 27 May 2020 05:24:04 +0000 (07:24 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 May 2020 11:21:23 +0000 (05:21 -0600)
commit956d510ee78caebc83c0eaeb892db5b239a36a06
treefc0885d84a077101a601828ca2d3d8364c443b60
parentc81b49d4d6ca3876fad42fe99e685605294f757c
block: add disk/bio-based accounting helpers

Add two new helpers to simplify I/O accounting for bio based drivers.
Currently these drivers use the generic_start_io_acct and
generic_end_io_acct helpers which have very cumbersome calling
conventions, don't actually return the time they started accounting,
and try to deal with accounting for partitions, which can't happen
for bio based drivers.  The new helpers will be used to subsequently
replace uses of the old helpers.

The main API is the bio based wrappes in blkdev.h, but for zram
which wants to account rw_page based I/O lower level routines are
provided as well.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
include/linux/blkdev.h