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>
]) # 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
# 4.17
LC_VM_FAULT_T
+ LC_VM_FAULT_RETRY
LC_I_PAGES
# 4.18
#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"
#define FMODE_EXEC 0
#endif
-#ifndef VM_FAULT_RETRY
+#ifndef HAVE_VM_FAULT_RETRY
#define VM_FAULT_RETRY 0
#endif