]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
res_counter: delete res_counter_write()
authorGreg Thelen <gthelen@google.com>
Thu, 29 Nov 2012 03:18:07 +0000 (14:18 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:20 +0000 (16:23 +1100)
Since 628f423553 ("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>
include/linux/res_counter.h
kernel/res_counter.c

index 4b173b6b2c3b5f22e9c64d3f4b52d36eb2875a84..5ae8456d967010b8cb35b1d861d28a487e2103ba 100644 (file)
@@ -74,14 +74,9 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
                const char __user *buf, size_t nbytes, loff_t *pos,
                int (*read_strategy)(unsigned long long val, char *s));
 
-typedef int (*write_strategy_fn)(const char *buf, unsigned long long *val);
-
 int res_counter_memparse_write_strategy(const char *buf,
                                        unsigned long long *res);
 
-int res_counter_write(struct res_counter *counter, int member,
-                     const char *buffer, write_strategy_fn write_strategy);
-
 /*
  * the field descriptors. one for each member of res_counter
  */
index 7b3d6dc2667bebc91a5f0e57261bc6bc5150e06b..ff55247e7049aeaf08fcf2d058ef6e5d5d20d76b 100644 (file)
@@ -198,25 +198,3 @@ int res_counter_memparse_write_strategy(const char *buf,
        *res = PAGE_ALIGN(*res);
        return 0;
 }
-
-int res_counter_write(struct res_counter *counter, int member,
-                     const char *buf, write_strategy_fn write_strategy)
-{
-       char *end;
-       unsigned long flags;
-       unsigned long long tmp, *val;
-
-       if (write_strategy) {
-               if (write_strategy(buf, &tmp))
-                       return -EINVAL;
-       } else {
-               tmp = simple_strtoull(buf, &end, 10);
-               if (*end != '\0')
-                       return -EINVAL;
-       }
-       spin_lock_irqsave(&counter->lock, flags);
-       val = res_counter_member(counter, member);
-       *val = tmp;
-       spin_unlock_irqrestore(&counter->lock, flags);
-       return 0;
-}