diff options
author | Li Zefan <lizefan@huawei.com> | 2013-09-12 18:13:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 18:38:00 -0400 |
commit | c33bd8354f3a3bb26a98d2b6bf600b7b35657328 (patch) | |
tree | 3a05898992a6bf4475051d9b49ace72f304473cf /mm/memcontrol.c | |
parent | d5d04bb48f0eb89c14e76779bb46212494de0bec (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 <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>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 8 |
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, | |||
4990 | unsigned int event) | 4990 | unsigned int event) |
4991 | { | 4991 | { |
4992 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); | 4992 | struct mem_cgroup *memcg = mem_cgroup_from_css(css); |
4993 | int ret; | ||
4994 | 4993 | ||
4995 | if (mem_cgroup_is_root(memcg)) | 4994 | if (mem_cgroup_is_root(memcg)) |
4996 | return -EINVAL; | 4995 | return -EINVAL; |
4997 | css_get(&memcg->css); | 4996 | return mem_cgroup_force_empty(memcg); |
4998 | ret = mem_cgroup_force_empty(memcg); | ||
4999 | css_put(&memcg->css); | ||
5000 | |||
5001 | return ret; | ||
5002 | } | 4997 | } |
5003 | 4998 | ||
5004 | |||
5005 | static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css, | 4999 | static u64 mem_cgroup_hierarchy_read(struct cgroup_subsys_state *css, |
5006 | struct cftype *cft) | 5000 | struct cftype *cft) |
5007 | { | 5001 | { |