X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Flinux%2Fcompat%2Finclude%2Flinux%2Fgenetlink.h;h=8b894be38ceadcbdcc0e88f903b252feea36f8a1;hb=699fec8cc02d2e2a367e64e89f5c64b902d3555a;hp=e45d08546ef66186b68dd407a0aa69a2449489de;hpb=22bcc0e70becd88bf895c44885d63704affe4284;p=openvswitch diff --git a/datapath/linux/compat/include/linux/genetlink.h b/datapath/linux/compat/include/linux/genetlink.h index e45d0854..8b894be3 100644 --- a/datapath/linux/compat/include/linux/genetlink.h +++ b/datapath/linux/compat/include/linux/genetlink.h @@ -1,15 +1,23 @@ #ifndef __GENETLINK_WRAPPER_H #define __GENETLINK_WRAPPER_H 1 +#include #include_next +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) #ifdef CONFIG_PROVE_LOCKING -/* No version of the kernel has this function, but our locking scheme depends - * on genl_mutex so for clarity we use it where appropriate. */ static inline int lockdep_genl_is_held(void) { return 1; } #endif +#endif + +#ifndef genl_dereference +#include + +#define genl_dereference(p) \ + rcu_dereference_protected(p, lockdep_genl_is_held()) +#endif #endif /* linux/genetlink.h wrapper */