aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/percpu_counter.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-05-26 07:51:31 -0400
committerIngo Molnar <mingo@elte.hu>2011-05-26 07:51:35 -0400
commitde66ee979d0ea45171cc2501750e9f9f22f5a690 (patch)
tree5ab1a5c6b596b9b786902fb380274e1e1f4ceb13 /include/linux/percpu_counter.h
parent916f676f8dc016103f983c7ec54c18ecdbb6e349 (diff)
parent4db70f73e56961b9bcdfd0c36c62847a18b7dbb5 (diff)
Merge branch 'linus' into x86/urgent
Merge reason: we want to queue up a dependent patch. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/percpu_counter.h')
-rw-r--r--include/linux/percpu_counter.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 46f6ba56fa91..5edc9014263a 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -75,7 +75,7 @@ static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
75 barrier(); /* Prevent reloads of fbc->count */ 75 barrier(); /* Prevent reloads of fbc->count */
76 if (ret >= 0) 76 if (ret >= 0)
77 return ret; 77 return ret;
78 return 1; 78 return 0;
79} 79}
80 80
81static inline int percpu_counter_initialized(struct percpu_counter *fbc) 81static inline int percpu_counter_initialized(struct percpu_counter *fbc)
@@ -133,6 +133,10 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc)
133 return fbc->count; 133 return fbc->count;
134} 134}
135 135
136/*
137 * percpu_counter is intended to track positive numbers. In the UP case the
138 * number should never be negative.
139 */
136static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) 140static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
137{ 141{
138 return fbc->count; 142 return fbc->count;