mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-21 14:21:48 +00:00
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>
This commit is contained in:
parent
6e6ff25bd5
commit
676f7c8f84
4 changed files with 65 additions and 83 deletions
|
@ -22,22 +22,6 @@
|
|||
#include <net/sock.h>
|
||||
#include <net/cls_cgroup.h>
|
||||
|
||||
static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp);
|
||||
static void cgrp_destroy(struct cgroup *cgrp);
|
||||
static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
|
||||
struct cgroup_subsys net_cls_subsys = {
|
||||
.name = "net_cls",
|
||||
.create = cgrp_create,
|
||||
.destroy = cgrp_destroy,
|
||||
.populate = cgrp_populate,
|
||||
#ifdef CONFIG_NET_CLS_CGROUP
|
||||
.subsys_id = net_cls_subsys_id,
|
||||
#endif
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
|
||||
static inline struct cgroup_cls_state *cgrp_cls_state(struct cgroup *cgrp)
|
||||
{
|
||||
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)
|
|||
return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files));
|
||||
}
|
||||
|
||||
struct cgroup_subsys net_cls_subsys = {
|
||||
.name = "net_cls",
|
||||
.create = cgrp_create,
|
||||
.destroy = cgrp_destroy,
|
||||
.populate = cgrp_populate,
|
||||
#ifdef CONFIG_NET_CLS_CGROUP
|
||||
.subsys_id = net_cls_subsys_id,
|
||||
#endif
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
struct cls_cgroup_head {
|
||||
u32 handle;
|
||||
struct tcf_exts exts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue