diff options
author | Ying Xue <ying.xue@windriver.com> | 2014-12-02 15:00:30 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-12-08 20:39:57 -0500 |
commit | 97ede29e80eead50d8bd533cf163401b88c027be (patch) | |
tree | c85f9f4af8b3e830847be0de35048bbd92218147 /include/linux/rculist.h | |
parent | 834caafa3e61f63805738376fa9c02dc0c1eb224 (diff) |
tipc: convert name table read-write lock to RCU
Convert tipc name table read-write lock to RCU. After this change,
a new spin lock is used to protect name table on write side while
RCU is applied on read side.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rculist.h')
-rw-r--r-- | include/linux/rculist.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 372ad5e0dcb..aa79b3c24f6 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h @@ -542,6 +542,15 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, pos = hlist_entry_safe(rcu_dereference_bh((pos)->member.next),\ typeof(*(pos)), member)) +/** + * hlist_for_each_entry_from_rcu - iterate over a hlist continuing from current point + * @pos: the type * to use as a loop cursor. + * @member: the name of the hlist_node within the struct. + */ +#define hlist_for_each_entry_from_rcu(pos, member) \ + for (; pos; \ + pos = hlist_entry_safe(rcu_dereference((pos)->member.next),\ + typeof(*(pos)), member)) #endif /* __KERNEL__ */ #endif |