From 1821c5a2de254bdd35aa5535e272d63e60774733 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 7 Sep 2019 03:43:59 +0000 Subject: [PATCH] scst/include/backport.h: Fix kvmalloc() backport for RHEL 7 The kvmalloc function was added in RHEL 7.5. So the backport is needed for RHEL 7.4 and older. _COMPAT_LINUX_MM_H is checked as well to avoid a conflict with the appropriate backport in MOFED. Signed-off-by: Sergey Gorenko [ bvanassche: fixed spelling in commit message ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8578 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 112c8dc98..989fc33b5 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -848,7 +848,9 @@ static inline void mempool_destroy_backport(mempool_t *pool) /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7 || \ + (RHEL_MAJOR -0 == 7 && RHEL_MINOR -0 < 5)) && \ + !defined(_COMPAT_LINUX_MM_H) /* See also commit a7c3e901a46f ("mm: introduce kv[mz]alloc helpers") # v4.12 */ static inline void *kvmalloc_node(size_t size, gfp_t flags, int node) {