Skip to content

Commit

Permalink
memcg: remove redundant code in mem_cgroup_force_empty_write()
Browse files Browse the repository at this point in the history
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>
Acked-by: Michal 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Sep 12, 2013
1 parent d5d04bb commit c33bd83
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit c33bd83

Please sign in to comment.