diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-03-17 16:31:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-20 18:44:35 -0400 |
commit | 5c578aedcb21d79eeb4e9cf04ca5b276ac82614c (patch) | |
tree | e6d682d3072fda2ae3977beca2beb23d222b6911 /include | |
parent | c2e21293c054817c42eb5fa9c613d2ad51954136 (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.h | 13 | ||||
-rw-r--r-- | include/net/if_inet6.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 2c9b46cff3d7..004908b104d5 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, | |||
428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
429 | pos = rcu_dereference_raw(pos->next)) | 429 | pos = rcu_dereference_raw(pos->next)) |
430 | 430 | ||
431 | /** | ||
432 | * hlist_for_each_entry_continue_rcu - iterate over a hlist continuing after current point | ||
433 | * @tpos: the type * to use as a loop cursor. | ||
434 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
435 | * @member: the name of the hlist_node within the struct. | ||
436 | */ | ||
437 | #define hlist_for_each_entry_continue_rcu(tpos, pos, member) \ | ||
438 | for (pos = rcu_dereference((pos)->next); \ | ||
439 | pos && ({ prefetch(pos->next); 1; }) && \ | ||
440 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | ||
441 | pos = rcu_dereference(pos->next)) | ||
442 | |||
443 | |||
431 | #endif /* __KERNEL__ */ | 444 | #endif /* __KERNEL__ */ |
432 | #endif | 445 | #endif |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 498401541519..22a00b1d2c38 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -64,6 +64,7 @@ struct inet6_ifaddr { | |||
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | int dead; | 66 | int dead; |
67 | struct rcu_head rcu; | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | struct ip6_sf_socklist { | 70 | struct ip6_sf_socklist { |