diff options
Diffstat (limited to 'include/linux/blk-cgroup.h')
-rw-r--r-- | include/linux/blk-cgroup.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index e9825ff57b15..69bea82ebeb1 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h | |||
@@ -660,12 +660,14 @@ static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat) | |||
660 | static inline void blkg_rwstat_add_aux(struct blkg_rwstat *to, | 660 | static inline void blkg_rwstat_add_aux(struct blkg_rwstat *to, |
661 | struct blkg_rwstat *from) | 661 | struct blkg_rwstat *from) |
662 | { | 662 | { |
663 | struct blkg_rwstat v = blkg_rwstat_read(from); | 663 | u64 sum[BLKG_RWSTAT_NR]; |
664 | int i; | 664 | int i; |
665 | 665 | ||
666 | for (i = 0; i < BLKG_RWSTAT_NR; i++) | 666 | for (i = 0; i < BLKG_RWSTAT_NR; i++) |
667 | atomic64_add(atomic64_read(&v.aux_cnt[i]) + | 667 | sum[i] = percpu_counter_sum_positive(&from->cpu_cnt[i]); |
668 | atomic64_read(&from->aux_cnt[i]), | 668 | |
669 | for (i = 0; i < BLKG_RWSTAT_NR; i++) | ||
670 | atomic64_add(sum[i] + atomic64_read(&from->aux_cnt[i]), | ||
669 | &to->aux_cnt[i]); | 671 | &to->aux_cnt[i]); |
670 | } | 672 | } |
671 | 673 | ||