Fix: add hlist lttng wrappers
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Apr 2015 21:39:35 +0000 (17:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Apr 2015 21:39:35 +0000 (17:39 -0400)
For older kernels (e.g. 2.6.38).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wrapper/list.h
wrapper/rcu.h

index 0d79e5128c7b36555fee4a266d24a99a2550054a..25e804069b71dd01f457c48b58cbc8c4e3022c50 100644 (file)
 #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; \
index d96d42d1de038e0ec9ae644332abb1d1e7627d2e..8c4cd7442c1907f6839d6629849b3c2b735187d8 100644 (file)
  * 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 */
This page took 0.026987 seconds and 4 git commands to generate.