summaryrefslogtreecommitdiff
path: root/drivers/md/multipath.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 14:56:14 +0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 10:56:08 +0400
commit074a7aca7afa6f230104e8e65eba3420263714a5 (patch)
treef418313e45bd55be8156c8a3e8f9a216cf63058d /drivers/md/multipath.c
parenteddb2e26b5ee3c5da68ba4bf1921ba20e2097bff (diff)
downloadlinux-074a7aca7afa6f230104e8e65eba3420263714a5.tar.xz
block: move stats from disk to part0
Move stats related fields - stamp, in_flight, dkstats - from disk to part0 and unify stat handling such that... * part_stat_*() now updates part0 together if the specified partition is not part0. ie. part_stat_*() are now essentially all_stat_*(). * {disk|all}_stat_*() are gone. * part_round_stats() is updated similary. It handles part0 stats automatically and disk_round_stats() is killed. * part_{inc|dec}_in_fligh() is implemented which automatically updates part0 stats for parts other than part0. * disk_map_sector_rcu() is updated to return part0 if no part matches. Combined with the above changes, this makes NULL special case handling in callers unnecessary. * Separate stats show code paths for disk are collapsed into part stats show code paths. * Rename disk_stat_lock/unlock() to part_stat_lock/unlock() While at it, reposition stat handling macros a bit and add missing parentheses around macro parameters. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r--drivers/md/multipath.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 182f5a94cdc5..8bb8794129b3 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -159,10 +159,11 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
mp_bh->master_bio = bio;
mp_bh->mddev = mddev;
- cpu = disk_stat_lock();
- disk_stat_inc(cpu, mddev->gendisk, ios[rw]);
- disk_stat_add(cpu, mddev->gendisk, sectors[rw], bio_sectors(bio));
- disk_stat_unlock();
+ cpu = part_stat_lock();
+ part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
+ part_stat_add(cpu, &mddev->gendisk->part0, sectors[rw],
+ bio_sectors(bio));
+ part_stat_unlock();
mp_bh->path = multipath_map(conf);
if (mp_bh->path < 0) {