Lines Matching defs:rwstat
3 * Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT.
35 static inline u64 blkg_rwstat_read_counter(struct blkg_rwstat *rwstat,
38 return atomic64_read(&rwstat->aux_cnt[idx]) +
39 percpu_counter_sum_positive(&rwstat->cpu_cnt[idx]);
42 int blkg_rwstat_init(struct blkg_rwstat *rwstat, gfp_t gfp);
43 void blkg_rwstat_exit(struct blkg_rwstat *rwstat);
45 const struct blkg_rwstat_sample *rwstat);
54 * @rwstat: target blkg_rwstat
58 * Add @val to @rwstat. The counters are chosen according to @rw. The
61 static inline void blkg_rwstat_add(struct blkg_rwstat *rwstat,
67 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_DISCARD];
69 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_WRITE];
71 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_READ];
76 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_SYNC];
78 cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_ASYNC];
85 * @rwstat: blkg_rwstat to read
87 * Read the current snapshot of @rwstat and return it in the aux counts.
89 static inline void blkg_rwstat_read(struct blkg_rwstat *rwstat,
96 percpu_counter_sum_positive(&rwstat->cpu_cnt[i]);
101 * @rwstat: blkg_rwstat to read
103 * Return the total count of @rwstat regardless of the IO direction. This
107 static inline uint64_t blkg_rwstat_total(struct blkg_rwstat *rwstat)
111 blkg_rwstat_read(rwstat, &tmp);
117 * @rwstat: blkg_rwstat to reset
119 static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat)
124 percpu_counter_set(&rwstat->cpu_cnt[i], 0);
125 atomic64_set(&rwstat->aux_cnt[i], 0);