#include <linux/list.h>
#include <linux/rculist.h>
+/*
+ * return the first or the next element in an RCU protected hlist
+ */
+#define lttng_hlist_first_rcu(head) (*((struct hlist_node __rcu **)(&(head)->first)))
+#define lttng_hlist_next_rcu(node) (*((struct hlist_node __rcu **)(&(node)->next)))
+#define lttng_hlist_pprev_rcu(node) (*((struct hlist_node __rcu **)((node)->pprev)))
+
#define lttng_hlist_entry_safe(ptr, type, member) \
({ typeof(ptr) ____ptr = (ptr); \
____ptr ? hlist_entry(____ptr, type, member) : NULL; \
* not do any RCU debugging or tracing.
*/
#define lttng_hlist_for_each_entry_rcu(pos, head, member) \
- for (pos = lttng_hlist_entry_safe (lttng_rcu_dereference(hlist_first_rcu(head)), \
+ for (pos = lttng_hlist_entry_safe (lttng_rcu_dereference(lttng_hlist_first_rcu(head)), \
typeof(*(pos)), member); \
pos; \
- pos = lttng_hlist_entry_safe(lttng_rcu_dereference(hlist_next_rcu( \
+ pos = lttng_hlist_entry_safe(lttng_rcu_dereference(lttng_hlist_next_rcu( \
&(pos)->member)), typeof(*(pos)), member))
#endif /* _LTTNG_WRAPPER_RCU_H */