aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/percpu_counter.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/percpu_counter.h')
-rw-r--r--include/linux/percpu_counter.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 99de7a31bab8..a7684a513994 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -26,8 +26,16 @@ struct percpu_counter {
26 26
27extern int percpu_counter_batch; 27extern int percpu_counter_batch;
28 28
29int percpu_counter_init(struct percpu_counter *fbc, s64 amount); 29int __percpu_counter_init(struct percpu_counter *fbc, s64 amount,
30int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); 30 struct lock_class_key *key);
31
32#define percpu_counter_init(fbc, value) \
33 ({ \
34 static struct lock_class_key __key; \
35 \
36 __percpu_counter_init(fbc, value, &__key); \
37 })
38
31void percpu_counter_destroy(struct percpu_counter *fbc); 39void percpu_counter_destroy(struct percpu_counter *fbc);
32void percpu_counter_set(struct percpu_counter *fbc, s64 amount); 40void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
33void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); 41void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
@@ -81,8 +89,6 @@ static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount)
81 return 0; 89 return 0;
82} 90}
83 91
84#define percpu_counter_init_irq percpu_counter_init
85
86static inline void percpu_counter_destroy(struct percpu_counter *fbc) 92static inline void percpu_counter_destroy(struct percpu_counter *fbc)
87{ 93{
88} 94}