aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-11 12:34:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-13 23:38:49 -0500
commitce81b76a39835a721cd168e0c0bcfe7132f1f66b (patch)
treeed725dd6163f328d4717fb3ed28c9e6c2691bc88 /include/linux/netdevice.h
parentbee7ca9ec03a26676ea2b1c28dc4039348eff3e1 (diff)
ipv6: use RCU to walk list of network devices
No longer need read_lock(&dev_base_lock), use RCU instead. We also can avoid taking references on inet6_dev structs. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8b266390b9e..61425d0c612 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1114,6 +1114,16 @@ static inline struct net_device *next_net_device(struct net_device *dev)
1114 return lh == &net->dev_base_head ? NULL : net_device_entry(lh); 1114 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1115} 1115}
1116 1116
1117static inline struct net_device *next_net_device_rcu(struct net_device *dev)
1118{
1119 struct list_head *lh;
1120 struct net *net;
1121
1122 net = dev_net(dev);
1123 lh = rcu_dereference(dev->dev_list.next);
1124 return lh == &net->dev_base_head ? NULL : net_device_entry(lh);
1125}
1126
1117static inline struct net_device *first_net_device(struct net *net) 1127static inline struct net_device *first_net_device(struct net *net)
1118{ 1128{
1119 return list_empty(&net->dev_base_head) ? NULL : 1129 return list_empty(&net->dev_base_head) ? NULL :