diff options
author | Tejun Heo <tj@kernel.org> | 2008-08-25 06:56:14 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:08 -0400 |
commit | 074a7aca7afa6f230104e8e65eba3420263714a5 (patch) | |
tree | f418313e45bd55be8156c8a3e8f9a216cf63058d /drivers/block | |
parent | eddb2e26b5ee3c5da68ba4bf1921ba20e2097bff (diff) |
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/block')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 934800f979c9..961d29a53cab 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -758,15 +758,15 @@ diskstats(struct gendisk *disk, struct bio *bio, ulong duration, sector_t sector | |||
758 | struct hd_struct *part; | 758 | struct hd_struct *part; |
759 | int cpu; | 759 | int cpu; |
760 | 760 | ||
761 | cpu = disk_stat_lock(); | 761 | cpu = part_stat_lock(); |
762 | part = disk_map_sector_rcu(disk, sector); | 762 | part = disk_map_sector_rcu(disk, sector); |
763 | 763 | ||
764 | all_stat_inc(cpu, disk, part, ios[rw], sector); | 764 | part_stat_inc(cpu, part, ios[rw]); |
765 | all_stat_add(cpu, disk, part, ticks[rw], duration, sector); | 765 | part_stat_add(cpu, part, ticks[rw], duration); |
766 | all_stat_add(cpu, disk, part, sectors[rw], n_sect, sector); | 766 | part_stat_add(cpu, part, sectors[rw], n_sect); |
767 | all_stat_add(cpu, disk, part, io_ticks, duration, sector); | 767 | part_stat_add(cpu, part, io_ticks, duration); |
768 | 768 | ||
769 | disk_stat_unlock(); | 769 | part_stat_unlock(); |
770 | } | 770 | } |
771 | 771 | ||
772 | void | 772 | void |