summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-03-17 20:31:11 +0000
committerDavid S. Miller <davem@davemloft.net>2010-03-20 15:44:35 -0700
commit5c578aedcb21d79eeb4e9cf04ca5b276ac82614c (patch)
treee6d682d3072fda2ae3977beca2beb23d222b6911 /include
parentc2e21293c054817c42eb5fa9c613d2ad51954136 (diff)
IPv6: convert addrconf hash list to RCU
Convert from reader/writer lock to RCU and spinlock for addrconf hash list. Adds an additional helper macro for hlist_for_each_entry_continue_rcu to handle the continue case. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rculist.h13
-rw-r--r--include/net/if_inet6.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 2c9b46cff3d..004908b104d 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -428,5 +428,18 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
pos = rcu_dereference_raw(pos->next))
+/**
+ * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point
+ * @tpos: the type * to use as a loop cursor.
+ * @pos: the &struct hlist_node to use as a loop cursor.
+ * @member: the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_continue_rcu(tpos, pos, member) \
+ for (pos = rcu_dereference((pos)->next); \
+ pos && ({ prefetch(pos->next); 1; }) && \
+ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
+ pos = rcu_dereference(pos->next))
+
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 49840154151..22a00b1d2c3 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -64,6 +64,7 @@ struct inet6_ifaddr {
#endif
int dead;
+ struct rcu_head rcu;
};
struct ip6_sf_socklist {