diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/percpu_counter.h | 14 |
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 | ||
| 33 | int percpu_counter_init(struct percpu_counter *fbc, s64 amount); | 33 | int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, |
| 34 | int 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 | |||
| 35 | void percpu_counter_destroy(struct percpu_counter *fbc); | 43 | void percpu_counter_destroy(struct percpu_counter *fbc); |
| 36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); | 44 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); |
| 37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); | 45 | void __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 | |||
| 90 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 96 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
| 91 | { | 97 | { |
| 92 | } | 98 | } |
