diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-11 12:34:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-13 23:38:49 -0500 |
commit | ce81b76a39835a721cd168e0c0bcfe7132f1f66b (patch) | |
tree | ed725dd6163f328d4717fb3ed28c9e6c2691bc88 /include/linux/netdevice.h | |
parent | bee7ca9ec03a26676ea2b1c28dc4039348eff3e1 (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.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8b266390b9e2..61425d0c6123 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 | ||
1117 | static 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 | |||
1117 | static inline struct net_device *first_net_device(struct net *net) | 1127 | static 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 : |