aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
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/core
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/core')
-rw-r--r--net/core/netprio_cgroup.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index ba6900f73900..dbfd4e7f8dc4 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -23,21 +23,6 @@
23#include <net/sock.h> 23#include <net/sock.h>
24#include <net/netprio_cgroup.h> 24#include <net/netprio_cgroup.h>
25 25
26static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp);
27static void cgrp_destroy(struct cgroup *cgrp);
28static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp);
29
30struct cgroup_subsys net_prio_subsys = {
31 .name = "net_prio",
32 .create = cgrp_create,
33 .destroy = cgrp_destroy,
34 .populate = cgrp_populate,
35#ifdef CONFIG_NETPRIO_CGROUP
36 .subsys_id = net_prio_subsys_id,
37#endif
38 .module = THIS_MODULE
39};
40
41#define PRIOIDX_SZ 128 26#define PRIOIDX_SZ 128
42 27
43static unsigned long prioidx_map[PRIOIDX_SZ]; 28static unsigned long prioidx_map[PRIOIDX_SZ];
@@ -264,6 +249,17 @@ static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp)
264 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files)); 249 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files));
265} 250}
266 251
252struct cgroup_subsys net_prio_subsys = {
253 .name = "net_prio",
254 .create = cgrp_create,
255 .destroy = cgrp_destroy,
256 .populate = cgrp_populate,
257#ifdef CONFIG_NETPRIO_CGROUP
258 .subsys_id = net_prio_subsys_id,
259#endif
260 .module = THIS_MODULE
261};
262
267static int netprio_device_event(struct notifier_block *unused, 263static int netprio_device_event(struct notifier_block *unused,
268 unsigned long event, void *ptr) 264 unsigned long event, void *ptr)
269{ 265{