diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2015-03-12 00:04:08 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-03-12 14:39:40 -0400 |
| commit | efd7ef1c1929d7a0329d4349252863c04d6f1729 (patch) | |
| tree | 66a1d5ba57a27fda7665da756551c10ac0ebf656 /include | |
| parent | 6c7005f6cb1bf63bb1f505ef69364fb2cc00628e (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 'include')
| -rw-r--r-- | include/linux/netdevice.h | 3 | ||||
| -rw-r--r-- | include/net/fib_rules.h | 9 | ||||
| -rw-r--r-- | include/net/net_namespace.h | 29 | ||||
| -rw-r--r-- | include/net/sock.h | 2 |
4 files changed, 3 insertions, 40 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1354ae83efc8..cede40d9cac9 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1864,8 +1864,7 @@ static inline | |||
| 1864 | void dev_net_set(struct net_device *dev, struct net *net) | 1864 | void dev_net_set(struct net_device *dev, struct net *net) |
| 1865 | { | 1865 | { |
| 1866 | #ifdef CONFIG_NET_NS | 1866 | #ifdef CONFIG_NET_NS |
| 1867 | release_net(dev->nd_net); | 1867 | dev->nd_net = net; |
| 1868 | dev->nd_net = hold_net(net); | ||
| 1869 | #endif | 1868 | #endif |
| 1870 | } | 1869 | } |
| 1871 | 1870 | ||
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 88d2ae526961..6d67383a5114 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
| @@ -95,17 +95,10 @@ static inline void fib_rule_get(struct fib_rule *rule) | |||
| 95 | atomic_inc(&rule->refcnt); | 95 | atomic_inc(&rule->refcnt); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | static inline void fib_rule_put_rcu(struct rcu_head *head) | ||
| 99 | { | ||
| 100 | struct fib_rule *rule = container_of(head, struct fib_rule, rcu); | ||
| 101 | release_net(rule->fr_net); | ||
| 102 | kfree(rule); | ||
| 103 | } | ||
| 104 | |||
| 105 | static inline void fib_rule_put(struct fib_rule *rule) | 98 | static inline void fib_rule_put(struct fib_rule *rule) |
| 106 | { | 99 | { |
| 107 | if (atomic_dec_and_test(&rule->refcnt)) | 100 | if (atomic_dec_and_test(&rule->refcnt)) |
| 108 | call_rcu(&rule->rcu, fib_rule_put_rcu); | 101 | kfree_rcu(rule, rcu); |
| 109 | } | 102 | } |
| 110 | 103 | ||
| 111 | static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | 104 | static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index e086f4030dd2..fab51ceeabf3 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -49,11 +49,6 @@ struct net { | |||
| 49 | atomic_t count; /* To decided when the network | 49 | atomic_t count; /* To decided when the network |
| 50 | * namespace should be shut down. | 50 | * namespace should be shut down. |
| 51 | */ | 51 | */ |
| 52 | #ifdef NETNS_REFCNT_DEBUG | ||
| 53 | atomic_t use_count; /* To track references we | ||
| 54 | * destroy on demand | ||
| 55 | */ | ||
| 56 | #endif | ||
| 57 | spinlock_t rules_mod_lock; | 52 | spinlock_t rules_mod_lock; |
| 58 | 53 | ||
| 59 | atomic64_t cookie_gen; | 54 | atomic64_t cookie_gen; |
| @@ -236,30 +231,6 @@ int net_eq(const struct net *net1, const struct net *net2) | |||
| 236 | #endif | 231 | #endif |
| 237 | 232 | ||
| 238 | 233 | ||
| 239 | #ifdef NETNS_REFCNT_DEBUG | ||
| 240 | static inline struct net *hold_net(struct net *net) | ||
| 241 | { | ||
| 242 | if (net) | ||
| 243 | atomic_inc(&net->use_count); | ||
| 244 | return net; | ||
| 245 | } | ||
| 246 | |||
| 247 | static inline void release_net(struct net *net) | ||
| 248 | { | ||
| 249 | if (net) | ||
| 250 | atomic_dec(&net->use_count); | ||
| 251 | } | ||
| 252 | #else | ||
| 253 | static inline struct net *hold_net(struct net *net) | ||
| 254 | { | ||
| 255 | return net; | ||
| 256 | } | ||
| 257 | |||
| 258 | static inline void release_net(struct net *net) | ||
| 259 | { | ||
| 260 | } | ||
| 261 | #endif | ||
| 262 | |||
| 263 | #ifdef CONFIG_NET_NS | 234 | #ifdef CONFIG_NET_NS |
| 264 | 235 | ||
| 265 | static inline void write_pnet(struct net **pnet, struct net *net) | 236 | static inline void write_pnet(struct net **pnet, struct net *net) |
diff --git a/include/net/sock.h b/include/net/sock.h index d996c633bec2..95b2c1c220f9 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -2204,7 +2204,7 @@ static inline void sk_change_net(struct sock *sk, struct net *net) | |||
| 2204 | 2204 | ||
| 2205 | if (!net_eq(current_net, net)) { | 2205 | if (!net_eq(current_net, net)) { |
| 2206 | put_net(current_net); | 2206 | put_net(current_net); |
| 2207 | sock_net_set(sk, hold_net(net)); | 2207 | sock_net_set(sk, net); |
| 2208 | } | 2208 | } |
| 2209 | } | 2209 | } |
| 2210 | 2210 | ||
