You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[IPV6] ADDRCONF: Convert addrconf_lock to RCU.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
fbea49e1e2
commit
8814c4b533
@@ -133,20 +133,18 @@ extern int unregister_inet6addr_notifier(struct notifier_block *nb);
|
||||
static inline struct inet6_dev *
|
||||
__in6_dev_get(struct net_device *dev)
|
||||
{
|
||||
return (struct inet6_dev *)dev->ip6_ptr;
|
||||
return rcu_dereference(dev->ip6_ptr);
|
||||
}
|
||||
|
||||
extern rwlock_t addrconf_lock;
|
||||
|
||||
static inline struct inet6_dev *
|
||||
in6_dev_get(struct net_device *dev)
|
||||
{
|
||||
struct inet6_dev *idev = NULL;
|
||||
read_lock(&addrconf_lock);
|
||||
idev = dev->ip6_ptr;
|
||||
rcu_read_lock();
|
||||
idev = __in6_dev_get(dev);
|
||||
if (idev)
|
||||
atomic_inc(&idev->refcnt);
|
||||
read_unlock(&addrconf_lock);
|
||||
rcu_read_unlock();
|
||||
return idev;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user