Whamcloud - gitweb
LU-13731 autoconf: check if VM_FAULT_RETRY is defined 81/39281/2
authorJian Yu <yujian@whamcloud.com>
Sun, 5 Jul 2020 08:16:06 +0000 (01:16 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 20 Jul 2020 05:21:42 +0000 (05:21 +0000)
In RHEL 8.2 kernel 4.18.0-193.el8, VM_FAULT_RETRY is
defined as an enumeration constant in linux/mm_types.h
instead of a macro in linux/mm.h. This patch adds
autoconf macros to check if VM_FAULT_RETRY is defined
at configure time.

Test-Parameters: clientdistro=el8.2 serverdistro=el8.2 \
testlist=sanity

Test-Parameters: clientdistro=el8.1 serverdistro=el8.1 \
testlist=sanity

Fixes: 2e813f3e2d ("LU-13731 llite: include linux/mm_types.h for VM_FAULT_RETRY")
Change-Id: I2fdae7b62a53e447a7eb979787bdbd79423b787d
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/39281
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Ben Menadue <ben.menadue@anu.edu.au>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-core.m4
lustre/llite/llite_internal.h

index 9d96ed0..26d88d6 100644 (file)
@@ -1990,6 +1990,27 @@ vm_fault_t, [
 ]) # LC_VM_FAULT_T
 
 #
 ]) # LC_VM_FAULT_T
 
 #
+# LC_VM_FAULT_RETRY
+#
+# kernel 4.17 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
+# mm: VM_FAULT_RETRY is defined in enum vm_fault_reason
+#
+AC_DEFUN([LC_VM_FAULT_RETRY], [
+LB_CHECK_COMPILE([if VM_FAULT_RETRY is defined],
+VM_FAULT_RETRY, [
+       #include <linux/mm.h>
+],[
+       #ifndef VM_FAULT_RETRY
+               vm_fault_t x;
+               x = VM_FAULT_RETRY;
+       #endif
+],[
+       AC_DEFINE(HAVE_VM_FAULT_RETRY, 1,
+               [if VM_FAULT_RETRY is defined])
+])
+]) # LC_VM_FAULT_RETRY
+
+#
 # LC_INODE_TIMESPEC64
 #
 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
 # LC_INODE_TIMESPEC64
 #
 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
@@ -2395,6 +2416,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 4.17
        LC_VM_FAULT_T
 
        # 4.17
        LC_VM_FAULT_T
+       LC_VM_FAULT_RETRY
        LC_I_PAGES
 
        # 4.18
        LC_I_PAGES
 
        # 4.18
index cf7683c..6a1c658 100644 (file)
 #include <lustre_compat.h>
 #include <lustre_crypto.h>
 
 #include <lustre_compat.h>
 #include <lustre_crypto.h>
 
-#ifndef VM_FAULT_RETRY
-#include <linux/mm_types.h>
-#endif
-
 #include "vvp_internal.h"
 #include "range_lock.h"
 #include "pcc.h"
 #include "vvp_internal.h"
 #include "range_lock.h"
 #include "pcc.h"
@@ -59,7 +55,7 @@
 #define FMODE_EXEC 0
 #endif
 
 #define FMODE_EXEC 0
 #endif
 
-#ifndef VM_FAULT_RETRY
+#ifndef HAVE_VM_FAULT_RETRY
 #define VM_FAULT_RETRY 0
 #endif
 
 #define VM_FAULT_RETRY 0
 #endif