diff options
author | David Rientjes <rientjes@google.com> | 2014-04-07 18:37:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:35:54 -0400 |
commit | 539a13b47e462d28c48f076c63871580f694a366 (patch) | |
tree | b0db5d5314b1276d433c3ae826d3a19a8902bec6 /kernel/res_counter.c | |
parent | f0432d159601f96839f514f286eaa5b75c4112dc (diff) |
res_counter: remove interface for locked charging and uncharging
The res_counter_{charge,uncharge}_locked() variants are not used in the
kernel outside of the resource counter code itself, so remove the
interface.
Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Jianguo Wu <wujianguo@huawei.com>
Cc: Tim Hockin <thockin@google.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/res_counter.c')
-rw-r--r-- | kernel/res_counter.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/kernel/res_counter.c b/kernel/res_counter.c index 4aa8a305aede..51dbac6a3633 100644 --- a/kernel/res_counter.c +++ b/kernel/res_counter.c | |||
@@ -22,8 +22,18 @@ void res_counter_init(struct res_counter *counter, struct res_counter *parent) | |||
22 | counter->parent = parent; | 22 | counter->parent = parent; |
23 | } | 23 | } |
24 | 24 | ||
25 | int res_counter_charge_locked(struct res_counter *counter, unsigned long val, | 25 | static u64 res_counter_uncharge_locked(struct res_counter *counter, |
26 | bool force) | 26 | unsigned long val) |
27 | { | ||
28 | if (WARN_ON(counter->usage < val)) | ||
29 | val = counter->usage; | ||
30 | |||
31 | counter->usage -= val; | ||
32 | return counter->usage; | ||
33 | } | ||
34 | |||
35 | static int res_counter_charge_locked(struct res_counter *counter, | ||
36 | unsigned long val, bool force) | ||
27 | { | 37 | { |
28 | int ret = 0; | 38 | int ret = 0; |
29 | 39 | ||
@@ -86,15 +96,6 @@ int res_counter_charge_nofail(struct res_counter *counter, unsigned long val, | |||
86 | return __res_counter_charge(counter, val, limit_fail_at, true); | 96 | return __res_counter_charge(counter, val, limit_fail_at, true); |
87 | } | 97 | } |
88 | 98 | ||
89 | u64 res_counter_uncharge_locked(struct res_counter *counter, unsigned long val) | ||
90 | { | ||
91 | if (WARN_ON(counter->usage < val)) | ||
92 | val = counter->usage; | ||
93 | |||
94 | counter->usage -= val; | ||
95 | return counter->usage; | ||
96 | } | ||
97 | |||
98 | u64 res_counter_uncharge_until(struct res_counter *counter, | 99 | u64 res_counter_uncharge_until(struct res_counter *counter, |
99 | struct res_counter *top, | 100 | struct res_counter *top, |
100 | unsigned long val) | 101 | unsigned long val) |