aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/fib_rules.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-03-12 00:04:08 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-12 14:39:40 -0400
commitefd7ef1c1929d7a0329d4349252863c04d6f1729 (patch)
tree66a1d5ba57a27fda7665da756551c10ac0ebf656 /net/core/fib_rules.c
parent6c7005f6cb1bf63bb1f505ef69364fb2cc00628e (diff)
net: Kill hold_net release_net
hold_net and release_net were an idea that turned out to be useless. The code has been disabled since 2008. Kill the code it is long past due. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/fib_rules.c')
-rw-r--r--net/core/fib_rules.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index b55677fed1c8..68ea6950cad1 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -31,7 +31,7 @@ int fib_default_rule_add(struct fib_rules_ops *ops,
31 r->pref = pref; 31 r->pref = pref;
32 r->table = table; 32 r->table = table;
33 r->flags = flags; 33 r->flags = flags;
34 r->fr_net = hold_net(ops->fro_net); 34 r->fr_net = ops->fro_net;
35 35
36 r->suppress_prefixlen = -1; 36 r->suppress_prefixlen = -1;
37 r->suppress_ifgroup = -1; 37 r->suppress_ifgroup = -1;
@@ -116,7 +116,6 @@ static int __fib_rules_register(struct fib_rules_ops *ops)
116 if (ops->family == o->family) 116 if (ops->family == o->family)
117 goto errout; 117 goto errout;
118 118
119 hold_net(net);
120 list_add_tail_rcu(&ops->list, &net->rules_ops); 119 list_add_tail_rcu(&ops->list, &net->rules_ops);
121 err = 0; 120 err = 0;
122errout: 121errout:
@@ -160,15 +159,6 @@ static void fib_rules_cleanup_ops(struct fib_rules_ops *ops)
160 } 159 }
161} 160}
162 161
163static void fib_rules_put_rcu(struct rcu_head *head)
164{
165 struct fib_rules_ops *ops = container_of(head, struct fib_rules_ops, rcu);
166 struct net *net = ops->fro_net;
167
168 release_net(net);
169 kfree(ops);
170}
171
172void fib_rules_unregister(struct fib_rules_ops *ops) 162void fib_rules_unregister(struct fib_rules_ops *ops)
173{ 163{
174 struct net *net = ops->fro_net; 164 struct net *net = ops->fro_net;
@@ -178,7 +168,7 @@ void fib_rules_unregister(struct fib_rules_ops *ops)
178 fib_rules_cleanup_ops(ops); 168 fib_rules_cleanup_ops(ops);
179 spin_unlock(&net->rules_mod_lock); 169 spin_unlock(&net->rules_mod_lock);
180 170
181 call_rcu(&ops->rcu, fib_rules_put_rcu); 171 kfree_rcu(ops, rcu);
182} 172}
183EXPORT_SYMBOL_GPL(fib_rules_unregister); 173EXPORT_SYMBOL_GPL(fib_rules_unregister);
184 174
@@ -303,7 +293,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh)
303 err = -ENOMEM; 293 err = -ENOMEM;
304 goto errout; 294 goto errout;
305 } 295 }
306 rule->fr_net = hold_net(net); 296 rule->fr_net = net;
307 297
308 if (tb[FRA_PRIORITY]) 298 if (tb[FRA_PRIORITY])
309 rule->pref = nla_get_u32(tb[FRA_PRIORITY]); 299 rule->pref = nla_get_u32(tb[FRA_PRIORITY]);
@@ -423,7 +413,6 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh)
423 return 0; 413 return 0;
424 414
425errout_free: 415errout_free:
426 release_net(rule->fr_net);
427 kfree(rule); 416 kfree(rule);
428errout: 417errout:
429 rules_ops_put(ops); 418 rules_ops_put(ops);