block: Add part_stat_read_accum to read across field entries.
authorMichael Callahan <michaelcallahan@fb.com>
Wed, 18 Jul 2018 11:47:37 +0000 (04:47 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Jul 2018 14:44:16 +0000 (08:44 -0600)
commit59767fbd49d794b4499d30b314df6c0d4aca584b
treec9c02d6336a9408343a08065a032745740e898b2
parent3f289dcb4b265416a57ca79cf4a324060bb09060
block: Add part_stat_read_accum to read across field entries.

Add a part_stat_read_accum macro to genhd.h to read and sum across
field entries.  For example to sum up the number read and write
sectors completed.  In addition to being ar reasonable cleanup by
itself this will make it easier to add new stat fields in the future.

tj: Refreshed on top of v4.17.

Signed-off-by: Michael Callahan <michaelcallahan@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_worker.c
drivers/md/md.c
include/linux/genhd.h