datapath: Support for kernel 3.3
[sliver-openvswitch.git] / datapath / linux / compat / include / linux / genetlink.h
1 #ifndef __GENETLINK_WRAPPER_H
2 #define __GENETLINK_WRAPPER_H 1
3
4 #include <linux/version.h>
5 #include_next <linux/genetlink.h>
6
7 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
8 #ifdef CONFIG_PROVE_LOCKING
9 static inline int lockdep_genl_is_held(void)
10 {
11         return 1;
12 }
13 #endif
14 #endif
15
16 #ifndef genl_dereference
17 #include <linux/rcupdate.h>
18
19 #define genl_dereference(p)                                     \
20         rcu_dereference_protected(p, lockdep_genl_is_held())
21 #endif
22
23 #endif /* linux/genetlink.h wrapper */