diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-01 15:09:55 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-04-01 15:09:55 -0400 |
commit | 6bc103498f5fe512928496fc7802d639cc2d1d20 (patch) | |
tree | 15a9628ff89b48889ab7cf81822d689e0173ca2b /mm | |
parent | af36f906c0f4c2ffa0482ecdf856a33dc88ae8c5 (diff) |
cgroup: convert memcg controller to the new cftype interface
Convert memcg to use the new cftype based interface. kmem support
abuses ->populate() for mem_cgroup_sockets_init() so it can't be
removed at the moment.
tcp_memcontrol is updated so that tcp_files[] is registered via a
__initcall. This change also allows removing the forward declaration
of tcp_files[]. Removed.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Greg Thelen <gthelen@google.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 97a45b392f77..bef114258bbd 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4764,6 +4764,7 @@ static struct cftype mem_cgroup_files[] = { | |||
4764 | .read = mem_cgroup_read, | 4764 | .read = mem_cgroup_read, |
4765 | }, | 4765 | }, |
4766 | #endif | 4766 | #endif |
4767 | { }, /* terminate */ | ||
4767 | }; | 4768 | }; |
4768 | 4769 | ||
4769 | static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) | 4770 | static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) |
@@ -5041,15 +5042,7 @@ static void mem_cgroup_destroy(struct cgroup *cont) | |||
5041 | static int mem_cgroup_populate(struct cgroup_subsys *ss, | 5042 | static int mem_cgroup_populate(struct cgroup_subsys *ss, |
5042 | struct cgroup *cont) | 5043 | struct cgroup *cont) |
5043 | { | 5044 | { |
5044 | int ret; | 5045 | return register_kmem_files(cont, ss); |
5045 | |||
5046 | ret = cgroup_add_files(cont, ss, mem_cgroup_files, | ||
5047 | ARRAY_SIZE(mem_cgroup_files)); | ||
5048 | |||
5049 | if (!ret) | ||
5050 | ret = register_kmem_files(cont, ss); | ||
5051 | |||
5052 | return ret; | ||
5053 | } | 5046 | } |
5054 | 5047 | ||
5055 | #ifdef CONFIG_MMU | 5048 | #ifdef CONFIG_MMU |
@@ -5639,6 +5632,7 @@ struct cgroup_subsys mem_cgroup_subsys = { | |||
5639 | .can_attach = mem_cgroup_can_attach, | 5632 | .can_attach = mem_cgroup_can_attach, |
5640 | .cancel_attach = mem_cgroup_cancel_attach, | 5633 | .cancel_attach = mem_cgroup_cancel_attach, |
5641 | .attach = mem_cgroup_move_task, | 5634 | .attach = mem_cgroup_move_task, |
5635 | .base_cftypes = mem_cgroup_files, | ||
5642 | .early_init = 0, | 5636 | .early_init = 0, |
5643 | .use_id = 1, | 5637 | .use_id = 1, |
5644 | }; | 5638 | }; |