]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - lib/percpu_counter.c
lib: make percpu_counter_add take s64
[mirror_ubuntu-zesty-kernel.git] / lib / percpu_counter.c
index cf22c617baa44db8708f9908efc64b9f767e0c92..f7ac68c4c375c6e7867bf06321ffd3f1959ce16b 100644 (file)
@@ -14,15 +14,15 @@ static LIST_HEAD(percpu_counters);
 static DEFINE_MUTEX(percpu_counters_lock);
 #endif
 
-void percpu_counter_mod(struct percpu_counter *fbc, s32 amount)
+void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
 {
-       long count;
+       s64 count;
        s32 *pcount;
        int cpu = get_cpu();
 
        pcount = per_cpu_ptr(fbc->counters, cpu);
        count = *pcount + amount;
-       if (count >= FBC_BATCH || count <= -FBC_BATCH) {
+       if (count >= batch || count <= -batch) {
                spin_lock(&fbc->lock);
                fbc->count += count;
                *pcount = 0;
@@ -32,7 +32,7 @@ void percpu_counter_mod(struct percpu_counter *fbc, s32 amount)
        }
        put_cpu();
 }
-EXPORT_SYMBOL(percpu_counter_mod);
+EXPORT_SYMBOL(__percpu_counter_add);
 
 /*
  * Add up all the per-cpu counts, return the result.  This is a more accurate