Skip to content

Commit

Permalink
bridge: move br_net_exit() to br.c
Browse files Browse the repository at this point in the history
And it can become static.

Cc: Stephen Hemminger <[email protected]>
Cc: David S. Miller <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
congwang authored and davem330 committed Jan 14, 2014
1 parent ae237b3 commit b86f81c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
21 changes: 18 additions & 3 deletions net/bridge/br.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,29 @@

#include "br_private.h"

static const struct stp_proto br_stp_proto = {
.rcv = br_stp_rcv,
};
static void __net_exit br_net_exit(struct net *net)
{
struct net_device *dev;
LIST_HEAD(list);

rtnl_lock();
for_each_netdev(net, dev)
if (dev->priv_flags & IFF_EBRIDGE)
br_dev_delete(dev, &list);

unregister_netdevice_many(&list);
rtnl_unlock();

}

static struct pernet_operations br_net_ops = {
.exit = br_net_exit,
};

static const struct stp_proto br_stp_proto = {
.rcv = br_stp_rcv,
};

static int __init br_init(void)
{
int err;
Expand Down
15 changes: 0 additions & 15 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,18 +455,3 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)

return 0;
}

void __net_exit br_net_exit(struct net *net)
{
struct net_device *dev;
LIST_HEAD(list);

rtnl_lock();
for_each_netdev(net, dev)
if (dev->priv_flags & IFF_EBRIDGE)
br_dev_delete(dev, &list);

unregister_netdevice_many(&list);
rtnl_unlock();

}
1 change: 0 additions & 1 deletion net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ void br_flood_forward(struct net_bridge *br, struct sk_buff *skb,
void br_port_carrier_check(struct net_bridge_port *p);
int br_add_bridge(struct net *net, const char *name);
int br_del_bridge(struct net *net, const char *name);
void br_net_exit(struct net *net);
int br_add_if(struct net_bridge *br, struct net_device *dev);
int br_del_if(struct net_bridge *br, struct net_device *dev);
int br_min_mtu(const struct net_bridge *br);
Expand Down

0 comments on commit b86f81c

Please sign in to comment.