X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=wrapper%2Fvmalloc.h;h=362054b162b9e80eab799ca9be66298a697bb068;hb=9e52289bbd4698c76a4c6bf66d92ce04accdd54a;hp=e78d99bb199c18c83a7ec89923783059b0f8d60e;hpb=bf5a011d7256c26f8731be6b9983462f02b7c0cb;p=lttng-modules.git diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h index e78d99bb..362054b1 100644 --- a/wrapper/vmalloc.h +++ b/wrapper/vmalloc.h @@ -64,10 +64,23 @@ void wrapper_vmalloc_sync_mappings(void) } } +/* + * Canary function to check for 'vmalloc_sync_mappings()' at compile time. + * + * From 'include/linux/vmalloc.h': + * + * void vmalloc_sync_mappings(void); + */ +static inline +void __canary__vmalloc_sync_mappings(void) +{ + vmalloc_sync_mappings(); +} + #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ /* - * Map vmalloc_sync_mappings to vmalloc_sync_all() on kernels before 5.7. + * Map vmalloc_sync_mappings to vmalloc_sync_all() on kernels before 5.6. */ static inline void wrapper_vmalloc_sync_mappings(void) @@ -89,6 +102,19 @@ void wrapper_vmalloc_sync_mappings(void) } } +/* + * Canary function to check for 'vmalloc_sync_all()' at compile time. + * + * From 'include/linux/vmalloc.h': + * + * void vmalloc_sync_all(void); + */ +static inline +void __canary__vmalloc_sync_all(void) +{ + vmalloc_sync_all(); +} + #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ #else @@ -204,6 +230,26 @@ void *__lttng_vmalloc_node_range(unsigned long size, unsigned long align, return __vmalloc(size, gfp_mask, prot); } +/* + * Canary function to check for '__vmalloc_node_range()' at compile time. + * + * From 'include/linux/vmalloc.h': + * + * extern void *__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, + * const void *caller); + */ +static inline +void *__canary____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, + const void *caller) +{ + return __vmalloc_node_range(size, align, start, end, gfp_mask, prot, + vm_flags, node, caller); +} + /** * lttng_kvmalloc_node - attempt to allocate physically contiguous memory, but upon * failure, fall back to non-contiguous (vmalloc) allocation.