From: Michael Jeanson Date: Wed, 8 Jul 2020 18:45:22 +0000 (-0400) Subject: fix: no __lttng_vmalloc_node_range() prior to v2.6.38 X-Git-Tag: v2.11.5~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4b1927afc7b4523aa9ad9f4d3927071076e4bfe4;p=lttng-modules.git fix: no __lttng_vmalloc_node_range() prior to v2.6.38 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I9747c89f7b57448f4f1a5c1573ba2e81afe09a08 --- diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h index 91d46bd1..1f0d0c4e 100644 --- a/wrapper/vmalloc.h +++ b/wrapper/vmalloc.h @@ -310,7 +310,7 @@ void *__canary____lttng_vmalloc_node_range(unsigned long size, unsigned long ali node, caller); } -#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */ +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) /* * kallsyms wrapper of __vmalloc_node with a fallback to kmalloc_node. @@ -358,6 +358,20 @@ void *__canary____lttng_vmalloc_node_range(unsigned long size, unsigned long ali node, caller); } +#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) */ + +/* + * Basic fallback for kernel prior to 2.6.38 without __vmalloc_node_range() + */ +static inline +void *__lttng_vmalloc_node_range(unsigned long size, unsigned long align, + unsigned long start, unsigned long end, gfp_t gfp_mask, + pgprot_t prot, unsigned long vm_flags, int node, + void *caller) +{ + return __vmalloc(size, gfp_mask, prot); +} + #endif /**