diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2010-12-09 14:40:52 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2010-12-09 14:40:52 +1100 |
commit | 031d9abe933dc2bceb44e860339e82585f67d5fe (patch) | |
tree | fb32f672fb9d743bcfb96c81741d4ded12cf7948 /lib | |
parent | ed37be754cf8cf864629c96c95873c8dc884c9cf (diff) | |
parent | 5d201a6821425cb331a1dd5ccaba47fc75692e2b (diff) |
Merge remote branch 'percpu/for-next'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/percpu_counter.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index 604678d7d06d..28f2c33c6b53 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -72,18 +72,16 @@ EXPORT_SYMBOL(percpu_counter_set); void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch) { s64 count; - s32 *pcount; preempt_disable(); - pcount = this_cpu_ptr(fbc->counters); - count = *pcount + amount; + count = __this_cpu_read(*fbc->counters) + amount; if (count >= batch || count <= -batch) { spin_lock(&fbc->lock); fbc->count += count; - *pcount = 0; + __this_cpu_write(*fbc->counters, 0); spin_unlock(&fbc->lock); } else { - *pcount = count; + __this_cpu_write(*fbc->counters, count); } preempt_enable(); } |