From: Hauke Mehrtens Date: Sun, 22 May 2011 10:47:33 +0000 (+0200) Subject: compat: backport RCU_INIT_POINTER X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=092edf5ac80e46c0ea76f3945fbd71aded7acb2d;p=openwrt%2Fstaging%2Fblogic.git compat: backport RCU_INIT_POINTER Signed-off-by: Hauke Mehrtens --- diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h index a83c9c726214..e0dd6b43b3e7 100644 --- a/include/linux/compat-2.6.37.h +++ b/include/linux/compat-2.6.37.h @@ -115,6 +115,15 @@ extern void *vzalloc(unsigned long size); #define rtnl_dereference(p) \ rcu_dereference_protected(p, lockdep_rtnl_is_held()) +/** + * RCU_INIT_POINTER() - initialize an RCU protected pointer + * + * Initialize an RCU-protected pointer in such a way to avoid RCU-lockdep + * splats. + */ +#define RCU_INIT_POINTER(p, v) \ + p = (typeof(*v) __force __rcu *)(v) + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) */ #endif /* LINUX_26_37_COMPAT_H */