Home | History | Annotate | Download | only in linux

Lines Matching refs:fbc

29 static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
31 spin_lock_init(&fbc->lock);
32 fbc->count = amount;
33 fbc->counters = alloc_percpu(s32);
36 static inline void percpu_counter_destroy(struct percpu_counter *fbc)
38 free_percpu(fbc->counters);
41 void percpu_counter_mod(struct percpu_counter *fbc, s32 amount);
42 s64 percpu_counter_sum(struct percpu_counter *fbc);
44 static inline s64 percpu_counter_read(struct percpu_counter *fbc)
46 return fbc->count;
54 static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
56 s64 ret = fbc->count;
58 barrier(); /* Prevent reloads of fbc->count */
70 static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount)
72 fbc->count = amount;
75 static inline void percpu_counter_destroy(struct percpu_counter *fbc)
80 percpu_counter_mod(struct percpu_counter *fbc, s32 amount)
83 fbc->count += amount;
87 static inline s64 percpu_counter_read(struct percpu_counter *fbc)
89 return fbc->count;
92 static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
94 return fbc->count;
97 static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
99 return percpu_counter_read_positive(fbc);
104 static inline void percpu_counter_inc(struct percpu_counter *fbc)
106 percpu_counter_mod(fbc, 1);
109 static inline void percpu_counter_dec(struct percpu_counter *fbc)
111 percpu_counter_mod(fbc, -1);