From d8bc3df60f21c40885be465f3a636374ffab95df Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Sun, 5 Jul 2020 01:16:06 -0700 Subject: [PATCH] LU-13731 autoconf: check if VM_FAULT_RETRY is defined 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 Reviewed-on: https://review.whamcloud.com/39281 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Ben Menadue Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 22 ++++++++++++++++++++++ lustre/llite/llite_internal.h | 6 +----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 9d96ed0..26d88d6 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1990,6 +1990,27 @@ 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 +],[ + #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 @@ -2395,6 +2416,7 @@ AC_DEFUN([LC_PROG_LINUX], [ # 4.17 LC_VM_FAULT_T + LC_VM_FAULT_RETRY LC_I_PAGES # 4.18 diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index cf7683c..6a1c658 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -47,10 +47,6 @@ #include #include -#ifndef VM_FAULT_RETRY -#include -#endif - #include "vvp_internal.h" #include "range_lock.h" #include "pcc.h" @@ -59,7 +55,7 @@ #define FMODE_EXEC 0 #endif -#ifndef VM_FAULT_RETRY +#ifndef HAVE_VM_FAULT_RETRY #define VM_FAULT_RETRY 0 #endif -- 1.8.3.1