diff options
author | John Fastabend <john.fastabend@gmail.com> | 2014-10-06 06:27:53 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-07 00:02:32 +0200 |
commit | 82a470f1119eb7d2e4941b915bf9cd6fd8d54494 (patch) | |
tree | d16362829e33070f8367876205659fbf271ecfc2 /net/sched/em_ipset.c | |
parent | net: introduce netdevice gso_min_segs attribute (diff) | |
download | linux-82a470f1119eb7d2e4941b915bf9cd6fd8d54494.tar.xz linux-82a470f1119eb7d2e4941b915bf9cd6fd8d54494.zip |
net: sched: remove tcf_proto from ematch calls
This removes the tcf_proto argument from the ematch code paths that
only need it to reference the net namespace. This allows simplifying
qdisc code paths especially when we need to tear down the ematch
from an RCU callback. In this case we can not guarentee that the
tcf_proto structure is still valid.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/em_ipset.c')
-rw-r--r-- | net/sched/em_ipset.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sched/em_ipset.c b/net/sched/em_ipset.c index 527aeb7a3ff0..5b4a4efe468c 100644 --- a/net/sched/em_ipset.c +++ b/net/sched/em_ipset.c @@ -19,12 +19,11 @@ #include <net/ip.h> #include <net/pkt_cls.h> -static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len, +static int em_ipset_change(struct net *net, void *data, int data_len, struct tcf_ematch *em) { struct xt_set_info *set = data; ip_set_id_t index; - struct net *net = dev_net(qdisc_dev(tp->q)); if (data_len != sizeof(*set)) return -EINVAL; @@ -42,11 +41,11 @@ static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len, return -ENOMEM; } -static void em_ipset_destroy(struct tcf_proto *p, struct tcf_ematch *em) +static void em_ipset_destroy(struct tcf_ematch *em) { const struct xt_set_info *set = (const void *) em->data; if (set) { - ip_set_nfnl_put(dev_net(qdisc_dev(p->q)), set->index); + ip_set_nfnl_put(em->net, set->index); kfree((void *) em->data); } } |