From: Vladimir Sokolovsky Date: Mon, 19 Aug 2013 15:36:53 +0000 (+0300) Subject: compat: Avoid rcu_dereference_protected and kfree_rcu redefinition X-Git-Tag: vofed-3.5-x X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=de310fa8ecd2b457e0bdcbe621191a25b69a6e09;p=~emulex%2Fcompat.git compat: Avoid rcu_dereference_protected and kfree_rcu redefinition bug: 2421 Signed-off-by: Vladimir Sokolovsky --- diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h index 2035e35..dc1539d 100644 --- a/include/linux/compat-2.6.34.h +++ b/include/linux/compat-2.6.34.h @@ -287,11 +287,15 @@ static inline int usb_enable_autosuspend(struct usb_device *udev) static inline int usb_disable_autosuspend(struct usb_device *udev) { return 0; } -#ifndef CONFIG_COMPAT_RHEL_6_4 +#ifndef rcu_dereference_protected #define rcu_dereference_protected(p, c) (p) +#endif +#ifndef rcu_access_pointer #define rcu_access_pointer(p) ACCESS_ONCE(p) +#endif +#ifndef rcu_dereference_raw #define rcu_dereference_raw(p) rcu_dereference(p) -#endif /* CONFIG_COMPAT_RHEL_6_4 */ +#endif #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ diff --git a/include/linux/compat-3.0.h b/include/linux/compat-3.0.h index 85dbace..f307974 100644 --- a/include/linux/compat-3.0.h +++ b/include/linux/compat-3.0.h @@ -81,7 +81,9 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t { return kstrtoint_from_user(s, count, base, res); } +#endif /* CONFIG_COMPAT_RHEL_6_4 */ +#ifndef kfree_rcu /* * This adds a nested function everywhere kfree_rcu() was called. This * function frees the memory and is given as a function to call_rcu(). @@ -97,7 +99,7 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t } \ call_rcu(&(data)->rcuhead, __kfree_rcu_fn); \ } while (0) -#endif /* CONFIG_COMPAT_RHEL_6_4 */ +#endif #ifdef MODULE