From c5165838e558b010af93beebfa1c3359b8c6fe8b Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Fri, 18 Oct 2019 17:34:30 -0400 Subject: [PATCH] env: implement vmalloc with GFP flags Signed-off-by: Adam Rutkowski --- modules/cas_cache/ocf_env.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/cas_cache/ocf_env.h b/modules/cas_cache/ocf_env.h index 3237d44..7e30513 100644 --- a/modules/cas_cache/ocf_env.h +++ b/modules/cas_cache/ocf_env.h @@ -40,14 +40,24 @@ static inline void env_free(const void *ptr) kfree(ptr); } +static inline void *env_vmalloc_flags(size_t size, int flags) +{ + return __vmalloc(size, flags | __GFP_HIGHMEM, PAGE_KERNEL); +} + +static inline void *env_vzalloc_flags(size_t size, int flags) +{ + return env_vmalloc_flags(size, flags | __GFP_ZERO); +} + static inline void *env_vmalloc(size_t size) { - return vmalloc(size); + return env_vmalloc_flags(size, GFP_KERNEL); } static inline void *env_vzalloc(size_t size) { - return vzalloc(size); + return env_vzalloc_flags(size, GFP_KERNEL); } static inline void env_vfree(const void *ptr)