Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286694
b: refs/heads/master
c: 8cfd14a
h: refs/heads/master
v: v3
  • Loading branch information
Glauber Costa authored and David S. Miller committed Jan 22, 2012
1 parent d3cdaf7 commit 374af31
Show file tree
Hide file tree
Showing 2 changed files with 5 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: 376be5ff8a6a36efadd131860cf26841f366d44c
refs/heads/master: 8cfd14ad1eb52e44cb1fe7b47a68126e45e04026
5 changes: 4 additions & 1 deletion trunk/include/linux/res_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ static inline unsigned long long res_counter_margin(struct res_counter *cnt)
unsigned long flags;

spin_lock_irqsave(&cnt->lock, flags);
margin = cnt->limit - cnt->usage;
if (cnt->limit > cnt->usage)
margin = cnt->limit - cnt->usage;
else
margin = 0;
spin_unlock_irqrestore(&cnt->lock, flags);
return margin;
}
Expand Down

0 comments on commit 374af31

Please sign in to comment.