diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2006-09-22 17:44:24 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:20:26 -0400 |
commit | 8814c4b533817df825485ff32ce6ac406c3a54d1 (patch) | |
tree | b72cc3513e7dc4b60e98c7ddebe76bca188f88fc /include/net | |
parent | fbea49e1e2404baa2d88ab47e2db89e49551b53b (diff) |
[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/net')
-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 5fc8627435eb..aa2ed8f0a9dd 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -133,20 +133,18 @@ extern int unregister_inet6addr_notifier(struct notifier_block *nb); | |||
133 | static inline struct inet6_dev * | 133 | static inline struct inet6_dev * |
134 | __in6_dev_get(struct net_device *dev) | 134 | __in6_dev_get(struct net_device *dev) |
135 | { | 135 | { |
136 | return (struct inet6_dev *)dev->ip6_ptr; | 136 | return rcu_dereference(dev->ip6_ptr); |
137 | } | 137 | } |
138 | 138 | ||
139 | extern rwlock_t addrconf_lock; | ||
140 | |||
141 | static inline struct inet6_dev * | 139 | static inline struct inet6_dev * |
142 | in6_dev_get(struct net_device *dev) | 140 | in6_dev_get(struct net_device *dev) |
143 | { | 141 | { |
144 | struct inet6_dev *idev = NULL; | 142 | struct inet6_dev *idev = NULL; |
145 | read_lock(&addrconf_lock); | 143 | rcu_read_lock(); |
146 | idev = dev->ip6_ptr; | 144 | idev = __in6_dev_get(dev); |
147 | if (idev) | 145 | if (idev) |
148 | atomic_inc(&idev->refcnt); | 146 | atomic_inc(&idev->refcnt); |
149 | read_unlock(&addrconf_lock); | 147 | rcu_read_unlock(); |
150 | return idev; | 148 | return idev; |
151 | } | 149 | } |
152 | 150 | ||
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index e459e1a0ae4a..34489c13c119 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -189,6 +189,7 @@ struct inet6_dev | |||
189 | struct ipv6_devconf cnf; | 189 | struct ipv6_devconf cnf; |
190 | struct ipv6_devstat stats; | 190 | struct ipv6_devstat stats; |
191 | unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ | 191 | unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ |
192 | struct rcu_head rcu; | ||
192 | }; | 193 | }; |
193 | 194 | ||
194 | extern struct ipv6_devconf ipv6_devconf; | 195 | extern struct ipv6_devconf ipv6_devconf; |