From e2f662e5eab4f148a4d797e6fa48e488048e55b9 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Tue, 24 May 2011 17:13:35 -0700 Subject: [PATCH] --- yaml --- r: 250982 b: refs/heads/master c: c84598bbfa756b7d042da31aa4e198ae866a6c7d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/percpu_counter.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 92665b1f2f3f..55e57945f2f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3c8f370ded3483b27f1218ff0051fcf0c7a2facd +refs/heads/master: c84598bbfa756b7d042da31aa4e198ae866a6c7d diff --git a/trunk/include/linux/percpu_counter.h b/trunk/include/linux/percpu_counter.h index 46f6ba56fa91..5edc9014263a 100644 --- a/trunk/include/linux/percpu_counter.h +++ b/trunk/include/linux/percpu_counter.h @@ -75,7 +75,7 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) barrier(); /* Prevent reloads of fbc->count */ if (ret >= 0) return ret; - return 1; + return 0; } static inline int percpu_counter_initialized(struct percpu_counter *fbc) @@ -133,6 +133,10 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc) return fbc->count; } +/* + * percpu_counter is intended to track positive numbers. In the UP case the + * number should never be negative. + */ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) { return fbc->count;