fix: no __lttng_vmalloc_node_range() prior to v2.6.38
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 8 Jul 2020 18:45:22 +0000 (14:45 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 13 Jul 2020 19:39:06 +0000 (15:39 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9747c89f7b57448f4f1a5c1573ba2e81afe09a08

wrapper/vmalloc.h

index 91d46bd1a1aa950fc4fbc32110218fc17460abe9..1f0d0c4e65041195136fb2f22f3b546984dee1c4 100644 (file)
@@ -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
 
 /**
This page took 0.029597 seconds and 4 git commands to generate.