From 092edf5ac80e46c0ea76f3945fbd71aded7acb2d Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 22 May 2011 12:47:33 +0200 Subject: [PATCH] compat: backport RCU_INIT_POINTER Signed-off-by: Hauke Mehrtens --- include/linux/compat-2.6.37.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h index a83c9c7..e0dd6b4 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 */ -- 2.41.0