aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-05 05:06:40 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-25 13:49:49 -0500
commitefe117ab8114f47f317b4803e5bc0104420bcba2 (patch)
tree25c06fcd2a56feb8831930043ce89b0700481035 /net/mac80211
parent4ba3eb034fb6fd1990ccc5a6d71d5abcda37b905 (diff)
mac80211: Speedup ieee80211_remove_interfaces()
Speedup ieee80211_remove_interfaces() by factorizing synchronize_rcu() calls Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/iface.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 1bf12a26b45e..80c16f6e2af6 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -860,22 +860,18 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata)
860void ieee80211_remove_interfaces(struct ieee80211_local *local) 860void ieee80211_remove_interfaces(struct ieee80211_local *local)
861{ 861{
862 struct ieee80211_sub_if_data *sdata, *tmp; 862 struct ieee80211_sub_if_data *sdata, *tmp;
863 LIST_HEAD(unreg_list);
863 864
864 ASSERT_RTNL(); 865 ASSERT_RTNL();
865 866
867 mutex_lock(&local->iflist_mtx);
866 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) { 868 list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
867 /*
868 * we cannot hold the iflist_mtx across unregister_netdevice,
869 * but we only need to hold it for list modifications to lock
870 * out readers since we're under the RTNL here as all other
871 * writers.
872 */
873 mutex_lock(&local->iflist_mtx);
874 list_del(&sdata->list); 869 list_del(&sdata->list);
875 mutex_unlock(&local->iflist_mtx);
876 870
877 unregister_netdevice(sdata->dev); 871 unregister_netdevice_queue(sdata->dev, &unreg_list);
878 } 872 }
873 mutex_unlock(&local->iflist_mtx);
874 unregister_netdevice_many(&unreg_list);
879} 875}
880 876
881static u32 ieee80211_idle_off(struct ieee80211_local *local, 877static u32 ieee80211_idle_off(struct ieee80211_local *local,