diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-07-27 20:16:16 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-07-27 20:16:16 +0200 |
commit | 15566bb468e8a65d82ca1bc664c79a1a0f129632 (patch) | |
tree | 80cad4cced4a18c2c42ea7a73f29d353b1f5808c /src/compat/compat.h | |
parent | 1d07bf06766294e9c109d025bd6009bac90de7b6 (diff) |
compat: work around odd kernels that backport kv[mz]alloc
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/compat.h')
-rw-r--r-- | src/compat/compat.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index a1a5061..67240ce 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -304,7 +304,7 @@ static inline u64 ktime_get_ns(void) #include <linux/vmalloc.h> #include <linux/mm.h> #include <linux/slab.h> -static inline void *kvmalloc(size_t size, gfp_t flags) +static inline void *kvmalloc_ours(size_t size, gfp_t flags) { gfp_t kmalloc_flags = flags; void *ret; @@ -318,10 +318,12 @@ static inline void *kvmalloc(size_t size, gfp_t flags) return ret; return __vmalloc(size, flags, PAGE_KERNEL); } -static inline void *kvzalloc(size_t size, gfp_t flags) +static inline void *kvzalloc_ours(size_t size, gfp_t flags) { - return kvmalloc(size, flags | __GFP_ZERO); + return kvmalloc_ours(size, flags | __GFP_ZERO); } +#define kvmalloc kvmalloc_ours +#define kvzalloc kvzalloc_ours #endif #if ((LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 41)) && !defined(ISUBUNTU1404) |