aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
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
commit676f7c8f84d15e94065841529016da5ab92e901b (patch)
tree29c267a4c5711f9eaca7fa88fd7a78d39c8c4eac /net/sched
parent6e6ff25bd548a0c5bf5163e4f63e2793dcefbdcb (diff)
cgroup: relocate cftype and cgroup_subsys definitions in controllers
blk-cgroup, netprio_cgroup, cls_cgroup and tcp_memcontrol unnecessarily define cftype array and cgroup_subsys structures at the top of the file, which is unconventional and necessiates forward declaration of methods. This patch relocates those below the definitions of the methods and removes the forward declarations. Note that forward declaration of tcp_files[] is added in tcp_memcontrol.c for tcp_init_cgroup(). This will be removed soon by another patch. This patch doesn't introduce any functional change. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_cgroup.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 1afaa284fcd7..024df8a32275 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -22,22 +22,6 @@
22#include <net/sock.h> 22#include <net/sock.h>
23#include <net/cls_cgroup.h> 23#include <net/cls_cgroup.h>
24 24
25static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp);
26static void cgrp_destroy(struct cgroup *cgrp);
27static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp);
28
29struct cgroup_subsys net_cls_subsys = {
30 .name = "net_cls",
31 .create = cgrp_create,
32 .destroy = cgrp_destroy,
33 .populate = cgrp_populate,
34#ifdef CONFIG_NET_CLS_CGROUP
35 .subsys_id = net_cls_subsys_id,
36#endif
37 .module = THIS_MODULE,
38};
39
40
41static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp) 25static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp)
42{ 26{
43 return container_of(cgroup_subsys_state(cgrp, net_cls_subsys_id), 27 return container_of(cgroup_subsys_state(cgrp, net_cls_subsys_id),
@@ -93,6 +77,17 @@ static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
93 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files)); 77 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files));
94} 78}
95 79
80struct cgroup_subsys net_cls_subsys = {
81 .name = "net_cls",
82 .create = cgrp_create,
83 .destroy = cgrp_destroy,
84 .populate = cgrp_populate,
85#ifdef CONFIG_NET_CLS_CGROUP
86 .subsys_id = net_cls_subsys_id,
87#endif
88 .module = THIS_MODULE,
89};
90
96struct cls_cgroup_head { 91struct cls_cgroup_head {
97 u32 handle; 92 u32 handle;
98 struct tcf_exts exts; 93 struct tcf_exts exts;