diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/res_counter.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 70587657dda..d3c61b4ebef 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c | |||
@@ -28,6 +28,8 @@ int res_counter_charge_locked(struct res_counter *counter, unsigned long val) | |||
28 | } | 28 | } |
29 | 29 | ||
30 | counter->usage += val; | 30 | counter->usage += val; |
31 | if (counter->usage > counter->max_usage) | ||
32 | counter->max_usage = counter->usage; | ||
31 | return 0; | 33 | return 0; |
32 | } | 34 | } |
33 | 35 | ||
@@ -66,6 +68,8 @@ res_counter_member(struct res_counter *counter, int member) | |||
66 | switch (member) { | 68 | switch (member) { |
67 | case RES_USAGE: | 69 | case RES_USAGE: |
68 | return &counter->usage; | 70 | return &counter->usage; |
71 | case RES_MAX_USAGE: | ||
72 | return &counter->max_usage; | ||
69 | case RES_LIMIT: | 73 | case RES_LIMIT: |
70 | return &counter->limit; | 74 | return &counter->limit; |
71 | case RES_FAILCNT: | 75 | case RES_FAILCNT: |