datapath: Cleanup compat support.
[sliver-openvswitch.git] / datapath / linux / compat / include / linux / rculist.h
1 #ifndef __LINUX_RCULIST_WRAPPER_H
2 #define __LINUX_RCULIST_WRAPPER_H
3
4 #include_next <linux/rculist.h>
5
6 #ifndef hlist_first_rcu
7 #define hlist_first_rcu(head)   (*((struct hlist_node __rcu **)(&(head)->first)))
8 #define hlist_next_rcu(node)    (*((struct hlist_node __rcu **)(&(node)->next)))
9 #define hlist_pprev_rcu(node)   (*((struct hlist_node __rcu **)((node)->pprev)))
10 #endif
11
12 #undef hlist_for_each_entry_rcu
13 #define hlist_for_each_entry_rcu(pos, head, member)                     \
14         for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
15                         typeof(*(pos)), member);                        \
16                 pos;                                                    \
17                 pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\
18                         &(pos)->member)), typeof(*(pos)), member))
19
20 #endif