Lines Matching defs:amount
60 void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
70 fbc->count = amount;
87 void percpu_counter_add_batch(struct percpu_counter *fbc, s64 amount, s32 batch)
93 count = __this_cpu_read(*fbc->counters) + amount;
97 __this_cpu_sub(*fbc->counters, count - amount);
100 this_cpu_add(*fbc->counters, amount);
154 int __percpu_counter_init_many(struct percpu_counter *fbc, s64 amount,
177 fbc[i].count = amount;
282 * Compare counter, and add amount if total is: less than or equal to limit if
283 * amount is positive, or greater than or equal to limit if amount is negative.
284 * Return true if amount is added, or false if total would be beyond the limit.
290 * Overflow beyond S64_MAX is not allowed for: counter, limit and amount
294 s64 limit, s64 amount, s32 batch)
301 if (amount == 0)
309 if (abs(count + amount) <= batch &&
310 ((amount > 0 && fbc->count + unknown <= limit) ||
311 (amount < 0 && fbc->count - unknown >= limit))) {
312 this_cpu_add(*fbc->counters, amount);
318 count = fbc->count + amount;
321 if (amount > 0) {
341 if (amount > 0) {
352 fbc->count += count + amount;