diff options
Diffstat (limited to 'net/sched/cls_cgroup.c')
-rw-r--r-- | net/sched/cls_cgroup.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 2ecde225ae60..31f06b633574 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
@@ -34,21 +34,25 @@ static inline struct cgroup_cls_state *task_cls_state(struct task_struct *p) | |||
34 | struct cgroup_cls_state, css); | 34 | struct cgroup_cls_state, css); |
35 | } | 35 | } |
36 | 36 | ||
37 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp) | 37 | static struct cgroup_subsys_state *cgrp_css_alloc(struct cgroup *cgrp) |
38 | { | 38 | { |
39 | struct cgroup_cls_state *cs; | 39 | struct cgroup_cls_state *cs; |
40 | 40 | ||
41 | cs = kzalloc(sizeof(*cs), GFP_KERNEL); | 41 | cs = kzalloc(sizeof(*cs), GFP_KERNEL); |
42 | if (!cs) | 42 | if (!cs) |
43 | return ERR_PTR(-ENOMEM); | 43 | return ERR_PTR(-ENOMEM); |
44 | return &cs->css; | ||
45 | } | ||
44 | 46 | ||
47 | static int cgrp_css_online(struct cgroup *cgrp) | ||
48 | { | ||
45 | if (cgrp->parent) | 49 | if (cgrp->parent) |
46 | cs->classid = cgrp_cls_state(cgrp->parent)->classid; | 50 | cgrp_cls_state(cgrp)->classid = |
47 | 51 | cgrp_cls_state(cgrp->parent)->classid; | |
48 | return &cs->css; | 52 | return 0; |
49 | } | 53 | } |
50 | 54 | ||
51 | static void cgrp_destroy(struct cgroup *cgrp) | 55 | static void cgrp_css_free(struct cgroup *cgrp) |
52 | { | 56 | { |
53 | kfree(cgrp_cls_state(cgrp)); | 57 | kfree(cgrp_cls_state(cgrp)); |
54 | } | 58 | } |
@@ -75,20 +79,12 @@ static struct cftype ss_files[] = { | |||
75 | 79 | ||
76 | struct cgroup_subsys net_cls_subsys = { | 80 | struct cgroup_subsys net_cls_subsys = { |
77 | .name = "net_cls", | 81 | .name = "net_cls", |
78 | .create = cgrp_create, | 82 | .css_alloc = cgrp_css_alloc, |
79 | .destroy = cgrp_destroy, | 83 | .css_online = cgrp_css_online, |
84 | .css_free = cgrp_css_free, | ||
80 | .subsys_id = net_cls_subsys_id, | 85 | .subsys_id = net_cls_subsys_id, |
81 | .base_cftypes = ss_files, | 86 | .base_cftypes = ss_files, |
82 | .module = THIS_MODULE, | 87 | .module = THIS_MODULE, |
83 | |||
84 | /* | ||
85 | * While net_cls cgroup has the rudimentary hierarchy support of | ||
86 | * inheriting the parent's classid on cgroup creation, it doesn't | ||
87 | * properly propagates config changes in ancestors to their | ||
88 | * descendents. A child should follow the parent's configuration | ||
89 | * but be allowed to override it. Fix it and remove the following. | ||
90 | */ | ||
91 | .broken_hierarchy = true, | ||
92 | }; | 88 | }; |
93 | 89 | ||
94 | struct cls_cgroup_head { | 90 | struct cls_cgroup_head { |