summaryrefslogtreecommitdiff
path: root/include/net/net_namespace.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-10 13:51:33 +0400
committerDavid S. Miller <davem@davemloft.net>2009-07-13 01:03:25 +0400
commit11a28d373ed2539a110d56419457e2e7db221ac7 (patch)
treed1460cb057299c89ff34b20821e30c8bfc7e589a /include/net/net_namespace.h
parent6c04bb18ddd633b7feac2c8fe2ae0bf61d20ca7a (diff)
downloadlinux-11a28d373ed2539a110d56419457e2e7db221ac7.tar.xz
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/net/net_namespace.h')
-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)
#define for_each_net(VAR) \
list_for_each_entry(VAR, &net_namespace_list, list)
+#define for_each_net_rcu(VAR) \
+ list_for_each_entry_rcu(VAR, &net_namespace_list, list)
+
#ifdef CONFIG_NET_NS
#define __net_init
#define __net_exit