]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - net/sched/cls_cgroup.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[can-eth-gw-linux.git] / net / sched / cls_cgroup.c
index 709b0fb38a1825f427b189cc49199e3d0a625d87..6db7855b9029ee26dcd97d73c43862a93c35b6c4 100644 (file)
@@ -35,21 +35,25 @@ static inline struct cgroup_cls_state *task_cls_state(struct task_struct *p)
                            struct cgroup_cls_state, css);
 }
 
-static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp)
+static struct cgroup_subsys_state *cgrp_css_alloc(struct cgroup *cgrp)
 {
        struct cgroup_cls_state *cs;
 
        cs = kzalloc(sizeof(*cs), GFP_KERNEL);
        if (!cs)
                return ERR_PTR(-ENOMEM);
+       return &cs->css;
+}
 
+static int cgrp_css_online(struct cgroup *cgrp)
+{
        if (cgrp->parent)
-               cs->classid = cgrp_cls_state(cgrp->parent)->classid;
-
-       return &cs->css;
+               cgrp_cls_state(cgrp)->classid =
+                       cgrp_cls_state(cgrp->parent)->classid;
+       return 0;
 }
 
-static void cgrp_destroy(struct cgroup *cgrp)
+static void cgrp_css_free(struct cgroup *cgrp)
 {
        kfree(cgrp_cls_state(cgrp));
 }
@@ -98,21 +102,13 @@ static struct cftype ss_files[] = {
 
 struct cgroup_subsys net_cls_subsys = {
        .name           = "net_cls",
-       .create         = cgrp_create,
-       .destroy        = cgrp_destroy,
+       .css_alloc      = cgrp_css_alloc,
+       .css_online     = cgrp_css_online,
+       .css_free       = cgrp_css_free,
        .attach         = cgrp_attach,
        .subsys_id      = net_cls_subsys_id,
        .base_cftypes   = ss_files,
        .module         = THIS_MODULE,
-
-       /*
-        * While net_cls cgroup has the rudimentary hierarchy support of
-        * inheriting the parent's classid on cgroup creation, it doesn't
-        * properly propagates config changes in ancestors to their
-        * descendents.  A child should follow the parent's configuration
-        * but be allowed to override it.  Fix it and remove the following.
-        */
-       .broken_hierarchy = true,
 };
 
 struct cls_cgroup_head {