aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
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 /kernel/sched
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 'kernel/sched')
-rw-r--r--kernel/sched/core.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index df00cb09263e..ff12f7216062 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7530,8 +7530,7 @@ static inline struct task_group *cgroup_tg(struct cgroup *cgrp)
7530 struct task_group, css); 7530 struct task_group, css);
7531} 7531}
7532 7532
7533static struct cgroup_subsys_state * 7533static struct cgroup_subsys_state *cpu_cgroup_create(struct cgroup *cgrp)
7534cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp)
7535{ 7534{
7536 struct task_group *tg, *parent; 7535 struct task_group *tg, *parent;
7537 7536
@@ -7548,15 +7547,14 @@ cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp)
7548 return &tg->css; 7547 return &tg->css;
7549} 7548}
7550 7549
7551static void 7550static void cpu_cgroup_destroy(struct cgroup *cgrp)
7552cpu_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
7553{ 7551{
7554 struct task_group *tg = cgroup_tg(cgrp); 7552 struct task_group *tg = cgroup_tg(cgrp);
7555 7553
7556 sched_destroy_group(tg); 7554 sched_destroy_group(tg);
7557} 7555}
7558 7556
7559static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 7557static int cpu_cgroup_can_attach(struct cgroup *cgrp,
7560 struct cgroup_taskset *tset) 7558 struct cgroup_taskset *tset)
7561{ 7559{
7562 struct task_struct *task; 7560 struct task_struct *task;
@@ -7574,7 +7572,7 @@ static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
7574 return 0; 7572 return 0;
7575} 7573}
7576 7574
7577static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 7575static void cpu_cgroup_attach(struct cgroup *cgrp,
7578 struct cgroup_taskset *tset) 7576 struct cgroup_taskset *tset)
7579{ 7577{
7580 struct task_struct *task; 7578 struct task_struct *task;
@@ -7584,8 +7582,8 @@ static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
7584} 7582}
7585 7583
7586static void 7584static void
7587cpu_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, 7585cpu_cgroup_exit(struct cgroup *cgrp, struct cgroup *old_cgrp,
7588 struct cgroup *old_cgrp, struct task_struct *task) 7586 struct task_struct *task)
7589{ 7587{
7590 /* 7588 /*
7591 * cgroup_exit() is called in the copy_process() failure path. 7589 * cgroup_exit() is called in the copy_process() failure path.
@@ -7935,8 +7933,7 @@ struct cgroup_subsys cpu_cgroup_subsys = {
7935 */ 7933 */
7936 7934
7937/* create a new cpu accounting group */ 7935/* create a new cpu accounting group */
7938static struct cgroup_subsys_state *cpuacct_create( 7936static struct cgroup_subsys_state *cpuacct_create(struct cgroup *cgrp)
7939 struct cgroup_subsys *ss, struct cgroup *cgrp)
7940{ 7937{
7941 struct cpuacct *ca; 7938 struct cpuacct *ca;
7942 7939
@@ -7966,8 +7963,7 @@ out:
7966} 7963}
7967 7964
7968/* destroy an existing cpu accounting group */ 7965/* destroy an existing cpu accounting group */
7969static void 7966static void cpuacct_destroy(struct cgroup *cgrp)
7970cpuacct_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp)
7971{ 7967{
7972 struct cpuacct *ca = cgroup_ca(cgrp); 7968 struct cpuacct *ca = cgroup_ca(cgrp);
7973 7969