From db3046b7f8c1d1a86d644fb8023b8aee55c484fc Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 4 Nov 2018 04:45:52 +0000 Subject: [PATCH] Merge r7488 from trunk git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7736 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index c35657eb5..46d312da6 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -832,15 +832,18 @@ static inline void put_unaligned_be64(uint64_t i, void *p) /* */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) -static inline void *vzalloc(size_t size) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 5 || \ + RHEL_MAJOR -0 == 5 && RHEL_MINOR -0 < 10 || \ + RHEL_MAJOR -0 == 6 && RHEL_MINOR -0 < 1) +/* + * See also patch "mm: add vzalloc() and vzalloc_node() helpers" (commit + * e1ca7788dec6773b1a2bce51b7141948f2b8bccf). + */ +static inline void *vzalloc(unsigned long size) { - void *p; - - p = vmalloc(size); - if (p) - memset(p, 0, size); - return p; + return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, + PAGE_KERNEL); } #endif