Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efd7ef1c authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

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: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c7005f6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1864,8 +1864,7 @@ static inline
void dev_net_set(struct net_device *dev, struct net *net)
{
#ifdef CONFIG_NET_NS
	release_net(dev->nd_net);
	dev->nd_net = hold_net(net);
	dev->nd_net = net;
#endif
}

+1 −8
Original line number Diff line number Diff line
@@ -95,17 +95,10 @@ static inline void fib_rule_get(struct fib_rule *rule)
	atomic_inc(&rule->refcnt);
}

static inline void fib_rule_put_rcu(struct rcu_head *head)
{
	struct fib_rule *rule = container_of(head, struct fib_rule, rcu);
	release_net(rule->fr_net);
	kfree(rule);
}

static inline void fib_rule_put(struct fib_rule *rule)
{
	if (atomic_dec_and_test(&rule->refcnt))
		call_rcu(&rule->rcu, fib_rule_put_rcu);
		kfree_rcu(rule, rcu);
}

static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla)
+0 −29
Original line number Diff line number Diff line
@@ -49,11 +49,6 @@ struct net {
	atomic_t		count;		/* To decided when the network
						 *  namespace should be shut down.
						 */
#ifdef NETNS_REFCNT_DEBUG
	atomic_t		use_count;	/* To track references we
						 * destroy on demand
						 */
#endif
	spinlock_t		rules_mod_lock;

	atomic64_t		cookie_gen;
@@ -236,30 +231,6 @@ int net_eq(const struct net *net1, const struct net *net2)
#endif


#ifdef NETNS_REFCNT_DEBUG
static inline struct net *hold_net(struct net *net)
{
	if (net)
		atomic_inc(&net->use_count);
	return net;
}

static inline void release_net(struct net *net)
{
	if (net)
		atomic_dec(&net->use_count);
}
#else
static inline struct net *hold_net(struct net *net)
{
	return net;
}

static inline void release_net(struct net *net)
{
}
#endif

#ifdef CONFIG_NET_NS

static inline void write_pnet(struct net **pnet, struct net *net)
+1 −1
Original line number Diff line number Diff line
@@ -2204,7 +2204,7 @@ static inline void sk_change_net(struct sock *sk, struct net *net)

	if (!net_eq(current_net, net)) {
		put_net(current_net);
		sock_net_set(sk, hold_net(net));
		sock_net_set(sk, net);
	}
}

+0 −2
Original line number Diff line number Diff line
@@ -6841,8 +6841,6 @@ void free_netdev(struct net_device *dev)
{
	struct napi_struct *p, *n;

	release_net(dev_net(dev));

	netif_free_tx_queues(dev);
#ifdef CONFIG_SYSFS
	kvfree(dev->_rx);
Loading