Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250982
b: refs/heads/master
c: c84598b
h: refs/heads/master
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed May 25, 2011
1 parent a4911ff commit e2f662e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c8f370ded3483b27f1218ff0051fcf0c7a2facd
refs/heads/master: c84598bbfa756b7d042da31aa4e198ae866a6c7d
6 changes: 5 additions & 1 deletion trunk/include/linux/percpu_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e2f662e

Please sign in to comment.