aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Thelen <gthelen@google.com>2012-12-12 16:51:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 20:38:33 -0500
commit44e33e8f95171b93968c3ac3cf8516998b1db65d (patch)
treeb0b56f8454b400e545f57bb63e767327bc72c788
parent6715ddf94576ff39f5d1cda8d4c568d3b79e82ec (diff)
res_counter: delete res_counter_write()
Since commit 628f42355389 ("memcg: limit change shrink usage") both res_counter_write() and write_strategy_fn have been unused. This patch deletes them both. Signed-off-by: Greg Thelen <gthelen@google.com> Cc: Glauber Costa <glommer@parallels.com> Cc: Tejun Heo <tj@kernel.org> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Frederic Weisbecker <fweisbec@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/res_counter.h5
-rw-r--r--kernel/res_counter.c22
2 files changed, 0 insertions, 27 deletions
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index 7d7fbe2ef782..6f54e40fa218 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -74,14 +74,9 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
74 const char __user *buf, size_t nbytes, loff_t *pos, 74 const char __user *buf, size_t nbytes, loff_t *pos,
75 int (*read_strategy)(unsigned long long val, char *s)); 75 int (*read_strategy)(unsigned long long val, char *s));
76 76
77typedef int (*write_strategy_fn)(const char *buf, unsigned long long *val);
78
79int res_counter_memparse_write_strategy(const char *buf, 77int res_counter_memparse_write_strategy(const char *buf,
80 unsigned long long *res); 78 unsigned long long *res);
81 79
82int res_counter_write(struct res_counter *counter, int member,
83 const char *buffer, write_strategy_fn write_strategy);
84
85/* 80/*
86 * the field descriptors. one for each member of res_counter 81 * the field descriptors. one for each member of res_counter
87 */ 82 */
diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index ad581aa2369a..3920d593e63c 100644
--- a/kernel/res_counter.c
+++ b/kernel/res_counter.c
@@ -192,25 +192,3 @@ int res_counter_memparse_write_strategy(const char *buf,
192 *res = PAGE_ALIGN(*res); 192 *res = PAGE_ALIGN(*res);
193 return 0; 193 return 0;
194} 194}
195
196int res_counter_write(struct res_counter *counter, int member,
197 const char *buf, write_strategy_fn write_strategy)
198{
199 char *end;
200 unsigned long flags;
201 unsigned long long tmp, *val;
202
203 if (write_strategy) {
204 if (write_strategy(buf, &tmp))
205 return -EINVAL;
206 } else {
207 tmp = simple_strtoull(buf, &end, 10);
208 if (*end != '\0')
209 return -EINVAL;
210 }
211 spin_lock_irqsave(&counter->lock, flags);
212 val = res_counter_member(counter, member);
213 *val = tmp;
214 spin_unlock_irqrestore(&counter->lock, flags);
215 return 0;
216}