diff options
author | Gu Zheng <guz.fnst@cn.fujitsu.com> | 2014-11-24 11:05:26 +0800 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-11-24 08:05:16 -0700 |
commit | 18c0b223cf9901727ef3b02da6711ac930b4e5d4 (patch) | |
tree | 4f1b835c2a1c97dbdfcadc69147e1178d60e6ca8 /drivers/md/md.c | |
parent | 244808543e6e9b46ea1135589877f4d4bd2925c5 (diff) | |
download | linux-18c0b223cf9901727ef3b02da6711ac930b4e5d4.tar.gz linux-18c0b223cf9901727ef3b02da6711ac930b4e5d4.tar.bz2 linux-18c0b223cf9901727ef3b02da6711ac930b4e5d4.zip |
md: use generic io stats accounting functions to simplify io stat accounting
Use generic io stats accounting help functions (generic_{start,end}_io_acct)
to simplify io stat accounting.
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 9233c71138f1..056ccd28c037 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -247,7 +247,6 @@ static void md_make_request(struct request_queue *q, struct bio *bio) { const int rw = bio_data_dir(bio); struct mddev *mddev = q->queuedata; - int cpu; unsigned int sectors; if (mddev == NULL || mddev->pers == NULL @@ -284,10 +283,7 @@ static void md_make_request(struct request_queue *q, struct bio *bio) sectors = bio_sectors(bio); mddev->pers->make_request(mddev, bio); - cpu = part_stat_lock(); - part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]); - part_stat_add(cpu, &mddev->gendisk->part0, sectors[rw], sectors); - part_stat_unlock(); + generic_start_io_acct(rw, sectors, &mddev->gendisk->part0); if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended) wake_up(&mddev->sb_wait); |