diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2006-09-22 21:44:24 (GMT) |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 22:20:26 (GMT) |
commit | 8814c4b533817df825485ff32ce6ac406c3a54d1 (patch) | |
tree | b72cc3513e7dc4b60e98c7ddebe76bca188f88fc /include | |
parent | fbea49e1e2404baa2d88ab47e2db89e49551b53b (diff) | |
download | linux-8814c4b533817df825485ff32ce6ac406c3a54d1.tar.xz |
[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>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/addrconf.h | 10 | ||||
-rw-r--r-- | include/net/if_inet6.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 5fc8627..aa2ed8f 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -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; } diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index e459e1a..34489c1 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h @@ -189,6 +189,7 @@ struct inet6_dev struct ipv6_devconf cnf; struct ipv6_devstat stats; unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ + struct rcu_head rcu; }; extern struct ipv6_devconf ipv6_devconf; |