aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2012-01-31 00:47:36 -0500
committerTejun Heo <tj@kernel.org>2012-02-02 12:20:22 -0500
commit761b3ef50e1c2649cffbfa67a4dcb2dcdb7982ed (patch)
tree67ab6a9a2520811c9c0b4d70d1c19b4bfca16237 /mm/memcontrol.c
parent61d1d219c4c0761059236a46867bc49943c4d29d (diff)
cgroup: remove cgroup_subsys argument from callbacks
The argument is not used at all, and it's not necessary, because a specific callback handler of course knows which subsys it belongs to. Now only ->pupulate() takes this argument, because the handlers of this callback always call cgroup_add_file()/cgroup_add_files(). So we reduce a few lines of code, though the shrinking of object size is minimal. 16 files changed, 113 insertions(+), 162 deletions(-) text data bss dec hex filename 5486240 656987 7039960 13183187 c928d3 vmlinux.o.orig 5486170 656987 7039960 13183117 c9288d vmlinux.o Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 3dbff4dcde35..ae2f0a8ab761 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4580,10 +4580,9 @@ static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss)
4580 return mem_cgroup_sockets_init(cont, ss); 4580 return mem_cgroup_sockets_init(cont, ss);
4581}; 4581};
4582 4582
4583static void kmem_cgroup_destroy(struct cgroup_subsys *ss, 4583static void kmem_cgroup_destroy(struct cgroup *cont)
4584 struct cgroup *cont)
4585{ 4584{
4586 mem_cgroup_sockets_destroy(cont, ss); 4585 mem_cgroup_sockets_destroy(cont);
4587} 4586}
4588#else 4587#else
4589static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss) 4588static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss)
@@ -4591,8 +4590,7 @@ static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss)
4591 return 0; 4590 return 0;
4592} 4591}
4593 4592
4594static void kmem_cgroup_destroy(struct cgroup_subsys *ss, 4593static void kmem_cgroup_destroy(struct cgroup *cont)
4595 struct cgroup *cont)
4596{ 4594{
4597} 4595}
4598#endif 4596#endif
@@ -4884,7 +4882,7 @@ err_cleanup:
4884} 4882}
4885 4883
4886static struct cgroup_subsys_state * __ref 4884static struct cgroup_subsys_state * __ref
4887mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) 4885mem_cgroup_create(struct cgroup *cont)
4888{ 4886{
4889 struct mem_cgroup *memcg, *parent; 4887 struct mem_cgroup *memcg, *parent;
4890 long error = -ENOMEM; 4888 long error = -ENOMEM;
@@ -4946,20 +4944,18 @@ free_out:
4946 return ERR_PTR(error); 4944 return ERR_PTR(error);
4947} 4945}
4948 4946
4949static int mem_cgroup_pre_destroy(struct cgroup_subsys *ss, 4947static int mem_cgroup_pre_destroy(struct cgroup *cont)
4950 struct cgroup *cont)
4951{ 4948{
4952 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); 4949 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
4953 4950
4954 return mem_cgroup_force_empty(memcg, false); 4951 return mem_cgroup_force_empty(memcg, false);
4955} 4952}
4956 4953
4957static void mem_cgroup_destroy(struct cgroup_subsys *ss, 4954static void mem_cgroup_destroy(struct cgroup *cont)
4958 struct cgroup *cont)
4959{ 4955{
4960 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); 4956 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
4961 4957
4962 kmem_cgroup_destroy(ss, cont); 4958 kmem_cgroup_destroy(cont);
4963 4959
4964 mem_cgroup_put(memcg); 4960 mem_cgroup_put(memcg);
4965} 4961}
@@ -5296,9 +5292,8 @@ static void mem_cgroup_clear_mc(void)
5296 mem_cgroup_end_move(from); 5292 mem_cgroup_end_move(from);
5297} 5293}
5298 5294
5299static int mem_cgroup_can_attach(struct cgroup_subsys *ss, 5295static int mem_cgroup_can_attach(struct cgroup *cgroup,
5300 struct cgroup *cgroup, 5296 struct cgroup_taskset *tset)
5301 struct cgroup_taskset *tset)
5302{ 5297{
5303 struct task_struct *p = cgroup_taskset_first(tset); 5298 struct task_struct *p = cgroup_taskset_first(tset);
5304 int ret = 0; 5299 int ret = 0;
@@ -5336,9 +5331,8 @@ static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
5336 return ret; 5331 return ret;
5337} 5332}
5338 5333
5339static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss, 5334static void mem_cgroup_cancel_attach(struct cgroup *cgroup,
5340 struct cgroup *cgroup, 5335 struct cgroup_taskset *tset)
5341 struct cgroup_taskset *tset)
5342{ 5336{
5343 mem_cgroup_clear_mc(); 5337 mem_cgroup_clear_mc();
5344} 5338}
@@ -5453,9 +5447,8 @@ retry:
5453 up_read(&mm->mmap_sem); 5447 up_read(&mm->mmap_sem);
5454} 5448}
5455 5449
5456static void mem_cgroup_move_task(struct cgroup_subsys *ss, 5450static void mem_cgroup_move_task(struct cgroup *cont,
5457 struct cgroup *cont, 5451 struct cgroup_taskset *tset)
5458 struct cgroup_taskset *tset)
5459{ 5452{
5460 struct task_struct *p = cgroup_taskset_first(tset); 5453 struct task_struct *p = cgroup_taskset_first(tset);
5461 struct mm_struct *mm = get_task_mm(p); 5454 struct mm_struct *mm = get_task_mm(p);
@@ -5470,20 +5463,17 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss,
5470 mem_cgroup_clear_mc(); 5463 mem_cgroup_clear_mc();
5471} 5464}
5472#else /* !CONFIG_MMU */ 5465#else /* !CONFIG_MMU */
5473static int mem_cgroup_can_attach(struct cgroup_subsys *ss, 5466static int mem_cgroup_can_attach(struct cgroup *cgroup,
5474 struct cgroup *cgroup, 5467 struct cgroup_taskset *tset)
5475 struct cgroup_taskset *tset)
5476{ 5468{
5477 return 0; 5469 return 0;
5478} 5470}
5479static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss, 5471static void mem_cgroup_cancel_attach(struct cgroup *cgroup,
5480 struct cgroup *cgroup, 5472 struct cgroup_taskset *tset)
5481 struct cgroup_taskset *tset)
5482{ 5473{
5483} 5474}
5484static void mem_cgroup_move_task(struct cgroup_subsys *ss, 5475static void mem_cgroup_move_task(struct cgroup *cont,
5485 struct cgroup *cont, 5476 struct cgroup_taskset *tset)
5486 struct cgroup_taskset *tset)
5487{ 5477{
5488} 5478}
5489#endif 5479#endif