summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-12-08 20:40:03 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-08 20:40:38 -0500
commit66813d4d04101c6342d74006eb36b8b59554fd51 (patch)
treec85f9f4af8b3e830847be0de35048bbd92218147 /include
parent60c04aecd8a72a84869308bdf2289a7aabb9a88c (diff)
parent97ede29e80eead50d8bd533cf163401b88c027be (diff)
downloadcachepc-linux-66813d4d04101c6342d74006eb36b8b59554fd51.tar.gz
cachepc-linux-66813d4d04101c6342d74006eb36b8b59554fd51.zip
Merge branch 'tipc-next'
Ying Xue says: ==================== tipc: convert name table read-write lock to RCU Now TIPC name table is statically allocated and is protected with a Read-Write lock. To enhance the performance of TIPC name table lookup, we are going to involve RCU lock to protect the name table. As a consequence, it becomes lockless to concurrently look up name table on read side. However, before the conversion can be successfully made, the following two things must be first done: - change allocation way of name table from static to dynamic - fix several incorrect locking policy issues ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rculist.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 372ad5e0dcb8..aa79b3c24f66 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