diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-11 17:34:30 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-13 20:38:49 -0800 |
commit | ce81b76a39835a721cd168e0c0bcfe7132f1f66b (patch) | |
tree | ed725dd6163f328d4717fb3ed28c9e6c2691bc88 /include/linux/netdevice.h | |
parent | bee7ca9ec03a26676ea2b1c28dc4039348eff3e1 (diff) | |
download | kernel_samsung_espresso10-ce81b76a39835a721cd168e0c0bcfe7132f1f66b.zip kernel_samsung_espresso10-ce81b76a39835a721cd168e0c0bcfe7132f1f66b.tar.gz kernel_samsung_espresso10-ce81b76a39835a721cd168e0c0bcfe7132f1f66b.tar.bz2 |
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 8b26639..61425d0 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) return lh == &net->dev_base_head ? NULL : net_device_entry(lh); } +static inline struct net_device *next_net_device_rcu(struct net_device *dev) +{ + struct list_head *lh; + struct net *net; + + net = dev_net(dev); + lh = rcu_dereference(dev->dev_list.next); + return lh == &net->dev_base_head ? NULL : net_device_entry(lh); +} + static inline struct net_device *first_net_device(struct net *net) { return list_empty(&net->dev_base_head) ? NULL : |