lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] memcg: remove redundant code in mem_cgroup_force_empty_write()
vfs guarantees the cgroup won't be destroyed, so it's redundant
to get a css reference.

Signed-off-by: Li Zefan <lizefan@huawei.com>
---
mm/memcontrol.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 03c8bf7..aa3e478 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5015,15 +5015,10 @@ static int mem_cgroup_force_empty(struct mem_cgroup *memcg)
static int mem_cgroup_force_empty_write(struct cgroup *cont, unsigned int event)
{
struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
- int ret;

if (mem_cgroup_is_root(memcg))
return -EINVAL;
- css_get(&memcg->css);
- ret = mem_cgroup_force_empty(memcg);
- css_put(&memcg->css);
-
- return ret;
+ return mem_cgroup_force_empty(memcg);
}


--
1.8.0.2

\
 
 \ /
  Last update: 2013-07-25 04:41    [W:0.037 / U:7.972 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site