diff options
Diffstat (limited to 'libbcachefs/util.h')
-rw-r--r-- | libbcachefs/util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libbcachefs/util.h b/libbcachefs/util.h index 7e1729a4..f7a35880 100644 --- a/libbcachefs/util.h +++ b/libbcachefs/util.h @@ -738,6 +738,16 @@ 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)) + #endif /* _BCACHEFS_UTIL_H */ |