1 #ifndef __LINUX_RCULIST_WRAPPER_H
2 #define __LINUX_RCULIST_WRAPPER_H
4 #include <linux/version.h>
5 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
6 #include_next <linux/rculist.h>
8 /* Prior to 2.6.26, the contents of rculist.h were part of list.h. */
9 #include <linux/list.h>
10 #include <linux/rcupdate.h>
13 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
14 #define hlist_del_init_rcu rpl_hlist_del_init_rcu
15 static inline void hlist_del_init_rcu(struct hlist_node *n)
17 if (!hlist_unhashed(n)) {
24 #ifndef hlist_first_rcu
25 #define hlist_first_rcu(head) (*((struct hlist_node __rcu **)(&(head)->first)))
26 #define hlist_next_rcu(node) (*((struct hlist_node __rcu **)(&(node)->next)))
27 #define hlist_pprev_rcu(node) (*((struct hlist_node __rcu **)((node)->pprev)))
30 #undef hlist_for_each_entry_rcu
31 #define hlist_for_each_entry_rcu(pos, head, member) \
32 for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
33 typeof(*(pos)), member); \
35 pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\
36 &(pos)->member)), typeof(*(pos)), member))