mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
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>
This commit is contained in:
committed by
David S. Miller
parent
bee7ca9ec0
commit
ce81b76a39
@@ -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 :
|
||||
|
||||
Reference in New Issue
Block a user