diff options
author | Denis Cheng <crquan@gmail.com> | 2007-07-18 05:10:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-07-18 05:10:54 -0400 |
commit | 456ad75c89cdb72e11dcdb6b0794802a6f50c8a3 (patch) | |
tree | 0e220771195438b704985418e47a7dc29d9a7d7b /net | |
parent | eb4965344965530411359891214cd6fcab483649 (diff) |
[NET]: move dev_mc_discard from dev_mcast.c to dev.c
Because this function is only called by unregister_netdevice,
this moving could make this non-global function static,
and also remove its declaration in netdevice.h;
Any further, function __dev_addr_discard is also just called by
dev_mc_discard and dev_unicast_discard, keeping this two functions
both in one c file could make __dev_addr_discard also static
and remove its declaration in netdevice.h;
Futhermore, the sequential call to dev_unicast_discard and then
dev_mc_discard in unregister_netdevice have a similar mechanism that:
(netif_tx_lock_bh / __dev_addr_discard / netif_tx_unlock_bh),
they should merged into one to eliminate duplicates in acquiring and
releasing the dev->_xmit_lock, this would be done in my following patch.
Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 14 | ||||
-rw-r--r-- | net/core/dev_mcast.c | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 13a0d9f6da54..3ba63aaa3001 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2715,7 +2715,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count, | |||
2715 | return 0; | 2715 | return 0; |
2716 | } | 2716 | } |
2717 | 2717 | ||
2718 | void __dev_addr_discard(struct dev_addr_list **list) | 2718 | static void __dev_addr_discard(struct dev_addr_list **list) |
2719 | { | 2719 | { |
2720 | struct dev_addr_list *tmp; | 2720 | struct dev_addr_list *tmp; |
2721 | 2721 | ||
@@ -2785,6 +2785,18 @@ static void dev_unicast_discard(struct net_device *dev) | |||
2785 | netif_tx_unlock_bh(dev); | 2785 | netif_tx_unlock_bh(dev); |
2786 | } | 2786 | } |
2787 | 2787 | ||
2788 | /* | ||
2789 | * Discard multicast list when a device is downed | ||
2790 | */ | ||
2791 | |||
2792 | static void dev_mc_discard(struct net_device *dev) | ||
2793 | { | ||
2794 | netif_tx_lock_bh(dev); | ||
2795 | __dev_addr_discard(&dev->mc_list); | ||
2796 | dev->mc_count = 0; | ||
2797 | netif_tx_unlock_bh(dev); | ||
2798 | } | ||
2799 | |||
2788 | unsigned dev_get_flags(const struct net_device *dev) | 2800 | unsigned dev_get_flags(const struct net_device *dev) |
2789 | { | 2801 | { |
2790 | unsigned flags; | 2802 | unsigned flags; |
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index 235a2a8a0d05..99aece1aeccf 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
@@ -177,18 +177,6 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) | |||
177 | } | 177 | } |
178 | EXPORT_SYMBOL(dev_mc_unsync); | 178 | EXPORT_SYMBOL(dev_mc_unsync); |
179 | 179 | ||
180 | /* | ||
181 | * Discard multicast list when a device is downed | ||
182 | */ | ||
183 | |||
184 | void dev_mc_discard(struct net_device *dev) | ||
185 | { | ||
186 | netif_tx_lock_bh(dev); | ||
187 | __dev_addr_discard(&dev->mc_list); | ||
188 | dev->mc_count = 0; | ||
189 | netif_tx_unlock_bh(dev); | ||
190 | } | ||
191 | |||
192 | #ifdef CONFIG_PROC_FS | 180 | #ifdef CONFIG_PROC_FS |
193 | static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) | 181 | static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) |
194 | { | 182 | { |