diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-14 23:05:36 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-17 22:33:16 -0600 |
commit | e3d5a96bb3391d12e77a9eb7baa7bae1dcad0829 (patch) | |
tree | ea9a5de9bb3c4999ba09f6e14d85cd0958d4e68f /src/compat/compat.h | |
parent | compat: nf_nat_core.h was removed upstream (diff) | |
download | wireguard-linux-compat-e3d5a96bb3391d12e77a9eb7baa7bae1dcad0829.tar.xz wireguard-linux-compat-e3d5a96bb3391d12e77a9eb7baa7bae1dcad0829.zip |
global: the _bh variety of rcu helpers have been unified
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r-- | src/compat/compat.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index 2dcdbae..396a293 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -778,6 +778,39 @@ struct __kernel_timespec { #define skb_probe_transport_header(a) skb_probe_transport_header(a, 0) #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) +/* Note that all intentional uses of the non-_bh variety need to explicitly + * undef these, conditionalized on COMPAT_CANNOT_DEPRECIATE_BH_RCU. + */ +#include <linux/rcupdate.h> +static __always_inline void old_synchronize_rcu(void) +{ + synchronize_rcu(); +} +static __always_inline void old_call_rcu(void *a, void *b) +{ + call_rcu(a, b); +} +static __always_inline void old_rcu_barrier(void) +{ + rcu_barrier(); +} +#ifdef synchronize_rcu +#undef synchronize_rcu +#endif +#ifdef call_rcu +#undef call_rcu +#endif +#ifdef rcu_barrier +#undef rcu_barrier +#endif +#define synchronize_rcu synchronize_rcu_bh +#define call_rcu call_rcu_bh +#define rcu_barrier rcu_barrier_bh +#define COMPAT_CANNOT_DEPRECIATE_BH_RCU +#endif + /* https://github.com/ClangBuiltLinux/linux/issues/7 */ #if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000) #include <linux/bug.h> |