Lines Matching refs:rwstat

205 static inline u64 blkg_rwstat_read_counter(struct blkg_rwstat *rwstat,  in blkg_rwstat_read_counter()  argument
208 return atomic64_read(&rwstat->aux_cnt[idx]) + in blkg_rwstat_read_counter()
209 percpu_counter_sum_positive(&rwstat->cpu_cnt[idx]); in blkg_rwstat_read_counter()
220 const struct blkg_rwstat_sample *rwstat);
581 static inline int blkg_rwstat_init(struct blkg_rwstat *rwstat, gfp_t gfp) in blkg_rwstat_init() argument
586 ret = percpu_counter_init(&rwstat->cpu_cnt[i], 0, gfp); in blkg_rwstat_init()
589 percpu_counter_destroy(&rwstat->cpu_cnt[i]); in blkg_rwstat_init()
592 atomic64_set(&rwstat->aux_cnt[i], 0); in blkg_rwstat_init()
597 static inline void blkg_rwstat_exit(struct blkg_rwstat *rwstat) in blkg_rwstat_exit() argument
602 percpu_counter_destroy(&rwstat->cpu_cnt[i]); in blkg_rwstat_exit()
614 static inline void blkg_rwstat_add(struct blkg_rwstat *rwstat, in blkg_rwstat_add() argument
620 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_DISCARD]; in blkg_rwstat_add()
622 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_WRITE]; in blkg_rwstat_add()
624 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_READ]; in blkg_rwstat_add()
629 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_SYNC]; in blkg_rwstat_add()
631 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_ASYNC]; in blkg_rwstat_add()
642 static inline void blkg_rwstat_read(struct blkg_rwstat *rwstat, in blkg_rwstat_read() argument
649 percpu_counter_sum_positive(&rwstat->cpu_cnt[i]); in blkg_rwstat_read()
660 static inline uint64_t blkg_rwstat_total(struct blkg_rwstat *rwstat) in blkg_rwstat_total() argument
664 blkg_rwstat_read(rwstat, &tmp); in blkg_rwstat_total()
672 static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat) in blkg_rwstat_reset() argument
677 percpu_counter_set(&rwstat->cpu_cnt[i], 0); in blkg_rwstat_reset()
678 atomic64_set(&rwstat->aux_cnt[i], 0); in blkg_rwstat_reset()