aboutsummaryrefslogtreecommitdiffstats
path: root/net
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 /net
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 'net')
-rw-r--r--net/core/netprio_cgroup.c8
-rw-r--r--net/sched/cls_cgroup.c8
2 files changed, 4 insertions, 12 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index dbfd4e7f8dc4..b2a59866699f 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -242,21 +242,17 @@ static struct cftype ss_files[] = {
242 .read_map = read_priomap, 242 .read_map = read_priomap,
243 .write_string = write_priomap, 243 .write_string = write_priomap,
244 }, 244 },
245 { } /* terminate */
245}; 246};
246 247
247static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
248{
249 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files));
250}
251
252struct cgroup_subsys net_prio_subsys = { 248struct cgroup_subsys net_prio_subsys = {
253 .name = "net_prio", 249 .name = "net_prio",
254 .create = cgrp_create, 250 .create = cgrp_create,
255 .destroy = cgrp_destroy, 251 .destroy = cgrp_destroy,
256 .populate = cgrp_populate,
257#ifdef CONFIG_NETPRIO_CGROUP 252#ifdef CONFIG_NETPRIO_CGROUP
258 .subsys_id = net_prio_subsys_id, 253 .subsys_id = net_prio_subsys_id,
259#endif 254#endif
255 .base_cftypes = ss_files,
260 .module = THIS_MODULE 256 .module = THIS_MODULE
261}; 257};
262 258
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 024df8a32275..7743ea8d1d38 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -70,21 +70,17 @@ static struct cftype ss_files[] = {
70 .read_u64 = read_classid, 70 .read_u64 = read_classid,
71 .write_u64 = write_classid, 71 .write_u64 = write_classid,
72 }, 72 },
73 { } /* terminate */
73}; 74};
74 75
75static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
76{
77 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files));
78}
79
80struct cgroup_subsys net_cls_subsys = { 76struct cgroup_subsys net_cls_subsys = {
81 .name = "net_cls", 77 .name = "net_cls",
82 .create = cgrp_create, 78 .create = cgrp_create,
83 .destroy = cgrp_destroy, 79 .destroy = cgrp_destroy,
84 .populate = cgrp_populate,
85#ifdef CONFIG_NET_CLS_CGROUP 80#ifdef CONFIG_NET_CLS_CGROUP
86 .subsys_id = net_cls_subsys_id, 81 .subsys_id = net_cls_subsys_id,
87#endif 82#endif
83 .base_cftypes = ss_files,
88 .module = THIS_MODULE, 84 .module = THIS_MODULE,
89}; 85};
90 86