diff options
Diffstat (limited to 'lib/percpu_counter.c')
-rw-r--r-- | lib/percpu_counter.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index 7a87003f8e8f..850449080e1c 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c | |||
@@ -5,10 +5,10 @@ | |||
5 | #include <linux/percpu_counter.h> | 5 | #include <linux/percpu_counter.h> |
6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
7 | 7 | ||
8 | void percpu_counter_mod(struct percpu_counter *fbc, long amount) | 8 | void percpu_counter_mod(struct percpu_counter *fbc, s32 amount) |
9 | { | 9 | { |
10 | long count; | 10 | long count; |
11 | long *pcount; | 11 | s32 *pcount; |
12 | int cpu = get_cpu(); | 12 | int cpu = get_cpu(); |
13 | 13 | ||
14 | pcount = per_cpu_ptr(fbc->counters, cpu); | 14 | pcount = per_cpu_ptr(fbc->counters, cpu); |
@@ -29,15 +29,15 @@ EXPORT_SYMBOL(percpu_counter_mod); | |||
29 | * Add up all the per-cpu counts, return the result. This is a more accurate | 29 | * Add up all the per-cpu counts, return the result. This is a more accurate |
30 | * but much slower version of percpu_counter_read_positive() | 30 | * but much slower version of percpu_counter_read_positive() |
31 | */ | 31 | */ |
32 | long percpu_counter_sum(struct percpu_counter *fbc) | 32 | s64 percpu_counter_sum(struct percpu_counter *fbc) |
33 | { | 33 | { |
34 | long ret; | 34 | s64 ret; |
35 | int cpu; | 35 | int cpu; |
36 | 36 | ||
37 | spin_lock(&fbc->lock); | 37 | spin_lock(&fbc->lock); |
38 | ret = fbc->count; | 38 | ret = fbc->count; |
39 | for_each_possible_cpu(cpu) { | 39 | for_each_possible_cpu(cpu) { |
40 | long *pcount = per_cpu_ptr(fbc->counters, cpu); | 40 | s32 *pcount = per_cpu_ptr(fbc->counters, cpu); |
41 | ret += *pcount; | 41 | ret += *pcount; |
42 | } | 42 | } |
43 | spin_unlock(&fbc->lock); | 43 | spin_unlock(&fbc->lock); |