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

Commit 2c8c1e72 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by David S. Miller
Browse files

net: spread __net_init, __net_exit



__net_init/__net_exit are apparently not going away, so use them
to full extent.

In some cases __net_init was removed, because it was called from
__net_exit code.

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72659ecc
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3307,7 +3307,7 @@ static void bond_remove_proc_entry(struct bonding *bond)
/* Create the bonding directory under /proc/net, if doesn't exist yet.
 * Caller must hold rtnl_lock.
 */
static void bond_create_proc_dir(struct bond_net *bn)
static void __net_init bond_create_proc_dir(struct bond_net *bn)
{
	if (!bn->proc_dir) {
		bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net);
@@ -3320,7 +3320,7 @@ static void bond_create_proc_dir(struct bond_net *bn)
/* Destroy the bonding directory under /proc/net, if empty.
 * Caller must hold rtnl_lock.
 */
static void bond_destroy_proc_dir(struct bond_net *bn)
static void __net_exit bond_destroy_proc_dir(struct bond_net *bn)
{
	if (bn->proc_dir) {
		remove_proc_entry(DRV_NAME, bn->net->proc_net);
@@ -3338,11 +3338,11 @@ static void bond_remove_proc_entry(struct bonding *bond)
{
}

static void bond_create_proc_dir(struct bond_net *bn)
static inline void bond_create_proc_dir(struct bond_net *bn)
{
}

static void bond_destroy_proc_dir(struct bond_net *bn)
static inline void bond_destroy_proc_dir(struct bond_net *bn)
{
}

@@ -4955,7 +4955,7 @@ out_netdev:
	goto out;
}

static int bond_net_init(struct net *net)
static int __net_init bond_net_init(struct net *net)
{
	struct bond_net *bn = net_generic(net, bond_net_id);

@@ -4967,7 +4967,7 @@ static int bond_net_init(struct net *net)
	return 0;
}

static void bond_net_exit(struct net *net)
static void __net_exit bond_net_exit(struct net *net)
{
	struct bond_net *bn = net_generic(net, bond_net_id);

+2 −2
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ out:
	return err;
}

static int vlan_init_net(struct net *net)
static int __net_init vlan_init_net(struct net *net)
{
	struct vlan_net *vn = net_generic(net, vlan_net_id);
	int err;
@@ -675,7 +675,7 @@ static int vlan_init_net(struct net *net)
	return err;
}

static void vlan_exit_net(struct net *net)
static void __net_exit vlan_exit_net(struct net *net)
{
	vlan_proc_cleanup(net);
}
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ void vlan_proc_cleanup(struct net *net)
 *	Create /proc/net/vlan entries
 */

int vlan_proc_init(struct net *net)
int __net_init vlan_proc_init(struct net *net)
{
	struct vlan_net *vn = net_generic(net, vlan_net_id);

+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
	return 0;
}

void br_net_exit(struct net *net)
void __net_exit br_net_exit(struct net *net)
{
	struct net_device *dev;
	LIST_HEAD(list);
+1 −1
Original line number Diff line number Diff line
@@ -708,7 +708,7 @@ static struct notifier_block fib_rules_notifier = {
	.notifier_call = fib_rules_event,
};

static int fib_rules_net_init(struct net *net)
static int __net_init fib_rules_net_init(struct net *net)
{
	INIT_LIST_HEAD(&net->rules_ops);
	spin_lock_init(&net->rules_mod_lock);
Loading