aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Zefan <[email protected]>2013-09-12 15:13:19 -0700
committerLinus Torvalds <[email protected]>2013-09-12 15:38:00 -0700
commitc33bd8354f3a3bb26a98d2b6bf600b7b35657328 (patch)
tree3a05898992a6bf4475051d9b49ace72f304473cf
parentd5d04bb48f0eb89c14e76779bb46212494de0bec (diff)
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 <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/memcontrol.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c6bd28edd533..fe6b9f96abdd 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4990,18 +4990,12 @@ static int mem_cgroup_force_empty_write(struct cgroup_subsys_state *css,
unsigned int event)
{
struct mem_cgroup *memcg = mem_cgroup_from_css(css);
- 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);
}
-
static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css,
struct cftype *cft)
{