summaryrefslogtreecommitdiff
path: root/fs/bcachefs/util.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-02-10 19:34:47 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:21 -0400
commit5e82a9a1f4f82e273530b90d107638a5969d1de0 (patch)
tree6e5c17c14f4f2a2589303b4d80a2bfc193818dd0 /fs/bcachefs/util.h
parentfca1223ccfac2a461d7d3e29fb09a1b2142bdd7f (diff)
bcachefs: Write out fs usage consistently
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r--fs/bcachefs/util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 59c8a1dac7be..c0910f230caf 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
@@ -741,6 +741,14 @@ static inline void acc_u64s_percpu(u64 *acc, const u64 __percpu *src,
acc_u64s(acc, per_cpu_ptr(src, cpu), nr);
}
+static inline void percpu_memset(void __percpu *p, int c, size_t bytes)
+{
+ int cpu;
+
+ for_each_possible_cpu(cpu)
+ memset(per_cpu_ptr(p, cpu), c, bytes);
+}
+
u64 *bch2_acc_percpu_u64s(u64 __percpu *, unsigned);
#define cmp_int(l, r) ((l > r) - (l < r))