cls_cgroup.c (f43dc23d5ea91fca257be02138a255f02d98e806) | cls_cgroup.c (cc7ec456f82da7f89a5b376e613b3ac4311b3e9a) |
---|---|
1/* 2 * net/sched/cls_cgroup.c Control Group Classifier 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 42 unchanged lines hidden (view full) --- 51 struct cgroup_cls_state, css); 52} 53 54static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, 55 struct cgroup *cgrp) 56{ 57 struct cgroup_cls_state *cs; 58 | 1/* 2 * net/sched/cls_cgroup.c Control Group Classifier 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 42 unchanged lines hidden (view full) --- 51 struct cgroup_cls_state, css); 52} 53 54static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, 55 struct cgroup *cgrp) 56{ 57 struct cgroup_cls_state *cs; 58 |
59 if (!(cs = kzalloc(sizeof(*cs), GFP_KERNEL))) | 59 cs = kzalloc(sizeof(*cs), GFP_KERNEL); 60 if (!cs) |
60 return ERR_PTR(-ENOMEM); 61 62 if (cgrp->parent) 63 cs->classid = cgrp_cls_state(cgrp->parent)->classid; 64 65 return &cs->css; 66} 67 --- 21 unchanged lines hidden (view full) --- 89 }, 90}; 91 92static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp) 93{ 94 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files)); 95} 96 | 61 return ERR_PTR(-ENOMEM); 62 63 if (cgrp->parent) 64 cs->classid = cgrp_cls_state(cgrp->parent)->classid; 65 66 return &cs->css; 67} 68 --- 21 unchanged lines hidden (view full) --- 90 }, 91}; 92 93static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp) 94{ 95 return cgroup_add_files(cgrp, ss, ss_files, ARRAY_SIZE(ss_files)); 96} 97 |
97struct cls_cgroup_head 98{ | 98struct cls_cgroup_head { |
99 u32 handle; 100 struct tcf_exts exts; 101 struct tcf_ematch_tree ematches; 102}; 103 104static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp, 105 struct tcf_result *res) 106{ --- 54 unchanged lines hidden (view full) --- 161static const struct nla_policy cgroup_policy[TCA_CGROUP_MAX + 1] = { 162 [TCA_CGROUP_EMATCHES] = { .type = NLA_NESTED }, 163}; 164 165static int cls_cgroup_change(struct tcf_proto *tp, unsigned long base, 166 u32 handle, struct nlattr **tca, 167 unsigned long *arg) 168{ | 99 u32 handle; 100 struct tcf_exts exts; 101 struct tcf_ematch_tree ematches; 102}; 103 104static int cls_cgroup_classify(struct sk_buff *skb, struct tcf_proto *tp, 105 struct tcf_result *res) 106{ --- 54 unchanged lines hidden (view full) --- 161static const struct nla_policy cgroup_policy[TCA_CGROUP_MAX + 1] = { 162 [TCA_CGROUP_EMATCHES] = { .type = NLA_NESTED }, 163}; 164 165static int cls_cgroup_change(struct tcf_proto *tp, unsigned long base, 166 u32 handle, struct nlattr **tca, 167 unsigned long *arg) 168{ |
169 struct nlattr *tb[TCA_CGROUP_MAX+1]; | 169 struct nlattr *tb[TCA_CGROUP_MAX + 1]; |
170 struct cls_cgroup_head *head = tp->root; 171 struct tcf_ematch_tree t; 172 struct tcf_exts e; 173 int err; 174 175 if (!tca[TCA_OPTIONS]) 176 return -EINVAL; 177 --- 148 unchanged lines hidden --- | 170 struct cls_cgroup_head *head = tp->root; 171 struct tcf_ematch_tree t; 172 struct tcf_exts e; 173 int err; 174 175 if (!tca[TCA_OPTIONS]) 176 return -EINVAL; 177 --- 148 unchanged lines hidden --- |