aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 15:09:55 -0400
committerTejun Heo <tj@kernel.org>2012-04-01 15:09:55 -0400
commit4baf6e33251b37f111e21289f8ee71fe4cce236e (patch)
tree7decc386a60679fd2696041810cf331c0daf1f41 /kernel/sched/core.c
parent676f7c8f84d15e94065841529016da5ab92e901b (diff)
cgroup: convert all non-memcg controllers to the new cftype interface
Convert debug, freezer, cpuset, cpu_cgroup, cpuacct, net_prio, blkio, net_cls and device controllers to use the new cftype based interface. Termination entry is added to cftype arrays and populate callbacks are replaced with cgroup_subsys->base_cftypes initializations. This is functionally identical transformation. There shouldn't be any visible behavior change. memcg is rather special and will be converted separately. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Paul Menage <paul@paulmenage.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 4603b9d8f30..afc6d7e7155 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7970,13 +7970,9 @@ static struct cftype cpu_files[] = {
7970 .write_u64 = cpu_rt_period_write_uint, 7970 .write_u64 = cpu_rt_period_write_uint,
7971 }, 7971 },
7972#endif 7972#endif
7973 { } /* terminate */
7973}; 7974};
7974 7975
7975static int cpu_cgroup_populate(struct cgroup_subsys *ss, struct cgroup *cont)
7976{
7977 return cgroup_add_files(cont, ss, cpu_files, ARRAY_SIZE(cpu_files));
7978}
7979
7980struct cgroup_subsys cpu_cgroup_subsys = { 7976struct cgroup_subsys cpu_cgroup_subsys = {
7981 .name = "cpu", 7977 .name = "cpu",
7982 .create = cpu_cgroup_create, 7978 .create = cpu_cgroup_create,
@@ -7984,8 +7980,8 @@ struct cgroup_subsys cpu_cgroup_subsys = {
7984 .can_attach = cpu_cgroup_can_attach, 7980 .can_attach = cpu_cgroup_can_attach,
7985 .attach = cpu_cgroup_attach, 7981 .attach = cpu_cgroup_attach,
7986 .exit = cpu_cgroup_exit, 7982 .exit = cpu_cgroup_exit,
7987 .populate = cpu_cgroup_populate,
7988 .subsys_id = cpu_cgroup_subsys_id, 7983 .subsys_id = cpu_cgroup_subsys_id,
7984 .base_cftypes = cpu_files,
7989 .early_init = 1, 7985 .early_init = 1,
7990}; 7986};
7991 7987
@@ -8170,13 +8166,9 @@ static struct cftype files[] = {
8170 .name = "stat", 8166 .name = "stat",
8171 .read_map = cpuacct_stats_show, 8167 .read_map = cpuacct_stats_show,
8172 }, 8168 },
8169 { } /* terminate */
8173}; 8170};
8174 8171
8175static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
8176{
8177 return cgroup_add_files(cgrp, ss, files, ARRAY_SIZE(files));
8178}
8179
8180/* 8172/*
8181 * charge this task's execution time to its accounting group. 8173 * charge this task's execution time to its accounting group.
8182 * 8174 *
@@ -8208,7 +8200,7 @@ struct cgroup_subsys cpuacct_subsys = {
8208 .name = "cpuacct", 8200 .name = "cpuacct",
8209 .create = cpuacct_create, 8201 .create = cpuacct_create,
8210 .destroy = cpuacct_destroy, 8202 .destroy = cpuacct_destroy,
8211 .populate = cpuacct_populate,
8212 .subsys_id = cpuacct_subsys_id, 8203 .subsys_id = cpuacct_subsys_id,
8204 .base_cftypes = files,
8213}; 8205};
8214#endif /* CONFIG_CGROUP_CPUACCT */ 8206#endif /* CONFIG_CGROUP_CPUACCT */