aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-10 05:51:33 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-12 17:03:25 -0400
commit11a28d373ed2539a110d56419457e2e7db221ac7 (patch)
treed1460cb057299c89ff34b20821e30c8bfc7e589a /include
parent6c04bb18ddd633b7feac2c8fe2ae0bf61d20ca7a (diff)
net: make namespace iteration possible under RCU
All we need to take care of is using proper RCU list add/del primitives and inserting a synchronize_rcu() at one place to make sure the exit notifiers are run after everybody has stopped iterating the list. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/net_namespace.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index ded434b032a4..b34a6ee73754 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -208,6 +208,9 @@ static inline struct net *read_pnet(struct net * const *pnet)
208#define for_each_net(VAR) \ 208#define for_each_net(VAR) \
209 list_for_each_entry(VAR, &net_namespace_list, list) 209 list_for_each_entry(VAR, &net_namespace_list, list)
210 210
211#define for_each_net_rcu(VAR) \
212 list_for_each_entry_rcu(VAR, &net_namespace_list, list)
213
211#ifdef CONFIG_NET_NS 214#ifdef CONFIG_NET_NS
212#define __net_init 215#define __net_init
213#define __net_exit 216#define __net_exit