Commit c33bd835 authored by Li Zefan's avatar Li Zefan Committed by Linus Torvalds

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: default avatarLi Zefan <lizefan@huawei.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.cz>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d5d04bb4
...@@ -4990,18 +4990,12 @@ static int mem_cgroup_force_empty_write(struct cgroup_subsys_state *css, ...@@ -4990,18 +4990,12 @@ static int mem_cgroup_force_empty_write(struct cgroup_subsys_state *css,
unsigned int event) unsigned int event)
{ {
struct mem_cgroup *memcg = mem_cgroup_from_css(css); struct mem_cgroup *memcg = mem_cgroup_from_css(css);
int ret;
if (mem_cgroup_is_root(memcg)) if (mem_cgroup_is_root(memcg))
return -EINVAL; return -EINVAL;
css_get(&memcg->css); return mem_cgroup_force_empty(memcg);
ret = mem_cgroup_force_empty(memcg);
css_put(&memcg->css);
return ret;
} }
static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css, static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css,
struct cftype *cft) struct cftype *cft)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment