aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-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 9007ccdfc112..96bdde36599f 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -30,8 +30,16 @@ struct percpu_counter {
30#define FBC_BATCH (NR_CPUS*4) 30#define FBC_BATCH (NR_CPUS*4)
31#endif 31#endif
32 32
33int percpu_counter_init(struct percpu_counter *fbc, s64 amount); 33int __percpu_counter_init(struct percpu_counter *fbc, s64 amount,
34int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); 34 struct lock_class_key *key);
35
36#define percpu_counter_init(fbc, value) \
37 ({ \
38 static struct lock_class_key __key; \
39 \
40 __percpu_counter_init(fbc, value, &__key); \
41 })
42
35void percpu_counter_destroy(struct percpu_counter *fbc); 43void percpu_counter_destroy(struct percpu_counter *fbc);
36void percpu_counter_set(struct percpu_counter *fbc, s64 amount); 44void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
37void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); 45void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
@@ -85,8 +93,6 @@ static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount)
85 return 0; 93 return 0;
86} 94}
87 95
88#define percpu_counter_init_irq percpu_counter_init
89
90static inline void percpu_counter_destroy(struct percpu_counter *fbc) 96static inline void percpu_counter_destroy(struct percpu_counter *fbc)
91{ 97{
92} 98}