Whamcloud - gitweb
LU-13590 kernel: new kernel [RHEL 7.9 3.10.0-1160.2.1.el7]
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 74d9743..b468523 100644 (file)
@@ -56,6 +56,16 @@ AC_CHECK_FUNCS([name_to_handle_at],
 ]) # LC_GLIBC_SUPPORT_FHANDLES
 
 #
+# LC_GLIBC_SUPPORT_COPY_FILE_RANGE
+#
+AC_DEFUN([LC_GLIBC_SUPPORT_COPY_FILE_RANGE], [
+AC_CHECK_FUNCS([copy_file_range],
+       [AC_DEFINE(HAVE_COPY_FILE_RANGE, 1,
+               [copy_file_range() is supported])],
+       [AC_MSG_WARN([copy_file_range() is not supported])])
+]) # LC_GLIBC_SUPPORT_COPY_FILE_RANGE
+
+#
 # LC_STACK_SIZE
 #
 # Ensure the stack size is at least 8k in Lustre server (all kernels)
@@ -102,7 +112,7 @@ AC_ARG_ENABLE([pinger],
        [], [enable_pinger="yes"])
 AC_MSG_RESULT([$enable_pinger])
 AS_IF([test "x$enable_pinger" != xno],
-       [AC_DEFINE(CONFIG_LUSTRE_PINGER, 1,[Use the Pinger])])
+       [AC_DEFINE(CONFIG_LUSTRE_FS_PINGER, 1,[Use the Pinger])])
 ]) # LC_CONFIG_PINGER
 
 #
@@ -285,6 +295,18 @@ AC_ARG_ENABLE([gss],
        [], [enable_gss="auto"])
 AC_MSG_RESULT([$enable_gss])
 
+AC_ARG_VAR([TEST_JOBS],
+    [simultaneous jobs during configure (defaults to $(nproc))])
+if test "x$ac_cv_env_TEST_JOBS_set" != "xset"; then
+       TEST_JOBS=${TEST_JOBS:-$(nproc)}
+fi
+AC_SUBST(TEST_JOBS)
+
+AC_ARG_VAR([TEST_DIR],
+    [location of temporary parallel configure tests (defaults to $PWD/lb2)])
+       TEST_DIR=${TEST_DIR:-$PWD/_lpb}
+AC_SUBST(TEST_DIR)
+
 AS_IF([test "x$enable_gss" != xno], [
        LC_CONFIG_GSS_KEYRING
        LC_KEY_TYPE_INSTANTIATE_2ARGS
@@ -365,12 +387,19 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
        enable_getsepol="no"
        AC_MSG_WARN([
 
-No openssk-devel headers found, unable to build l_getsepol and SELinux status checking
+No openssl-devel headers found, unable to build l_getsepol and SELinux status checking
 ])
 ])
 AC_MSG_RESULT([$enable_getsepol])
 ]) # LC_OPENSSL_GETSEPOL
 
+# LC_HAVE_LIBAIO
+AC_DEFUN([LC_HAVE_LIBAIO], [
+       AC_CHECK_HEADER([libaio.h],
+               enable_libaio="yes",
+               AC_MSG_WARN([libaio is not installed in the system]))
+]) # LC_HAVE_LIBAIO
+
 AC_DEFUN([LC_HAVE_PROJECT_QUOTA], [
 LB_CHECK_COMPILE([if get_projid exists],
 get_projid, [
@@ -428,6 +457,23 @@ dir_context, [
 ]) # LC_HAVE_DIR_CONTEXT
 
 #
+# LC_D_COMPARE_5ARGS
+#
+# 3.11 dentry_operations.d_compare() taken 5 arguments.
+#
+AC_DEFUN([LC_D_COMPARE_5ARGS], [
+LB_CHECK_COMPILE([if 'd_compare' taken 5 arguments],
+d_compare_5args, [
+       #include <linux/dcache.h>
+],[
+       ((struct dentry_operations*)0)->d_compare(NULL,NULL,0,NULL,NULL);
+],[
+       AC_DEFINE(HAVE_D_COMPARE_5ARGS, 1,
+               [d_compare need 5 arguments])
+])
+]) # LC_D_COMPARE_5ARGS
+
+#
 # LC_HAVE_DCOUNT
 #
 # 3.11 need to access d_count to get dentry reference count
@@ -1501,6 +1547,19 @@ fop_iterate_shared, [
 ]) # LC_FOP_ITERATE_SHARED
 
 #
+# LC_EXPORT_DEFAULT_FILE_SPLICE_READ
+#
+# 4.8-rc8 commit 82c156f853840645604acd7c2cebcb75ed1b6652 switched
+# generic_file_splice_read() to using ->read_iter. We can test this
+# change since default_file_splice_read() is no longer exported.
+#
+AC_DEFUN([LC_EXPORT_DEFAULT_FILE_SPLICE_READ], [
+LB_CHECK_EXPORT([default_file_splice_read], [fs/splice.c],
+       [AC_DEFINE(HAVE_DEFAULT_FILE_SPLICE_READ_EXPORT, 1,
+                       [default_file_splice_read is exported])])
+]) # LC_EXPORT_DEFAULT_FILE_SPLCE_READ
+
+#
 # LC_HAVE_POSIX_ACL_VALID_USER_NS
 #
 # 4.8 posix_acl_valid takes struct user_namespace
@@ -1519,6 +1578,24 @@ posix_acl_valid, [
 ]) # LC_HAVE_POSIX_ACL_VALID_USER_NS
 
 #
+# LC_D_COMPARE_4ARGS
+#
+# Kernel version 4.8 commit 6fa67e707559303e086303aeecc9e8b91ef497d5
+# get rid of 'parent' argument of ->d_compare()
+#
+AC_DEFUN([LC_D_COMPARE_4ARGS], [
+LB_CHECK_COMPILE([if 'd_compare' taken 4 arguments],
+d_compare_4args, [
+       #include <linux/dcache.h>
+],[
+       ((struct dentry_operations*)0)->d_compare(NULL,0,NULL,NULL);
+],[
+       AC_DEFINE(HAVE_D_COMPARE_4ARGS, 1,
+               [d_compare need 4 arguments])
+])
+]) # LC_D_COMPARE_4ARGS
+
+#
 # LC_FULL_NAME_HASH_3ARGS
 #
 # Kernel version 4.8 commit 8387ff2577eb9ed245df9a39947f66976c6bcd02
@@ -1933,6 +2010,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 <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
@@ -1947,6 +2045,9 @@ vm_fault_t, [
 # When inode times are timespec64 stop using the deprecated
 # time interfaces.
 #
+# kernel v5.5-rc1-6-gba70609d5ec6 ba70609d5ec664a8f36ba1c857fcd97a478adf79
+# fs: Delete timespec64_trunc()
+#
 AC_DEFUN([LC_INODE_TIMESPEC64], [
 tmp_flags="$EXTRA_KCFLAGS"
 EXTRA_KCFLAGS="-Werror"
@@ -1955,9 +2056,9 @@ inode_timespec64, [
        #include <linux/fs.h>
 ],[
        struct inode *inode = NULL;
-       struct timespec64 ts = {};
+       struct timespec64 ts = {0, 1};
 
-       inode->i_atime = timespec64_trunc(ts, 1);
+       inode->i_atime = ts;
        (void)inode;
 ],[
        AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
@@ -1967,41 +2068,25 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_INODE_TIMESPEC64
 
 #
-# LC_XA_IS_VALUE
-# kernel 4.19-rc6 commit 3159f943aafdbacb2f94c38fdaadabf2bbde2a14
-# xarray: Replace exceptional entries
-# adds xa_is_value
-#
-AC_DEFUN([LC_XA_IS_VALUE], [
-LB_CHECK_COMPILE([xa_is_value exist],
-xa_is_value, [
-       #include <linux/xarray.h>
-],[
-       xa_is_value(NULL);
-],[
-       AC_DEFINE(HAVE_XA_IS_VALUE, 1, [xa_is_value exist])
-])
-]) # LC_XA_IS_VALUE
-
-#
 # LC___XA_SET_MARK
 #
 # kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
-# xarray: Add XArray marks
+# xarray: Add XArray marks - replaced radix_tree_tag_set
 #
 AC_DEFUN([LC___XA_SET_MARK], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
 LB_CHECK_COMPILE([if '__xa_set_mark' exists],
 __xa_set_mark, [
-       #include <linux/xarray.h>
        #include <linux/fs.h>
+       #include <linux/radix-tree.h>
 ],[
-       struct xarray *xa = NULL;
-
-       __xa_set_mark(xa, 0, PAGECACHE_TAG_DIRTY);
+       radix_tree_tag_set(NULL, 0, PAGECACHE_TAG_DIRTY);
 ],[
-       AC_DEFINE(HAVE___XA_SET_MARK, 1,
+       AC_DEFINE(HAVE_RADIX_TREE_TAG_SET, 1,
                [__xa_set_mark exists])
 ])
+EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC___XA_SET_MARK
 
 #
@@ -2170,6 +2255,9 @@ lock_manager_ops_lm_compare_owner, [
 EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_LM_COMPARE_OWNER_EXISTS
 
+AC_DEFUN([LC_PROG_LINUX_SRC], [])
+AC_DEFUN([LC_PROG_LINUX_RESULTS], [])
+
 #
 # LC_FSCRYPT_SUPPORT
 #
@@ -2183,7 +2271,13 @@ fscrypt_support, [
 ],[
        fscrypt_ioctl_get_policy_ex(NULL, NULL);
 ],[
-       has_fscrypt_support="yes"
+       dnl When Lustre supports file name encryption, restore "yes" value
+       dnl for has_fscrypt_support and remove warning message.
+       has_fscrypt_support="no"
+       AC_MSG_WARN([
+This version of Lustre lacks file name encryption support,
+so it cannot make use of in-kernel fscrypt.
+Will use embedded llcrypt if possible.])
 ])
 ]) # LC_FSCRYPT_SUPPORT
 
@@ -2205,6 +2299,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_CONFIG_GSS
 
        LC_GLIBC_SUPPORT_FHANDLES
+       LC_GLIBC_SUPPORT_COPY_FILE_RANGE
        LC_OPENSSL_SSK
        LC_OPENSSL_GETSEPOL
 
@@ -2214,6 +2309,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 3.11
        LC_INVALIDATE_RANGE
        LC_HAVE_DIR_CONTEXT
+       LC_D_COMPARE_5ARGS
        LC_HAVE_DCOUNT
        LC_HAVE_DENTRY_D_U_D_ALIAS
        LC_HAVE_DENTRY_D_CHILD
@@ -2304,7 +2400,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_FOP_ITERATE_SHARED
 
        # 4.8
+       LC_EXPORT_DEFAULT_FILE_SPLICE_READ
        LC_HAVE_POSIX_ACL_VALID_USER_NS
+       LC_D_COMPARE_4ARGS
        LC_FULL_NAME_HASH_3ARGS
        LC_STRUCT_POSIX_ACL_XATTR
        LC_IOP_XATTR
@@ -2339,17 +2437,16 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 4.17
        LC_VM_FAULT_T
+       LC_VM_FAULT_RETRY
        LC_I_PAGES
 
        # 4.18
        LC_INODE_TIMESPEC64
-       LC_XA_IS_VALUE
 
        # 4.20
        LC___XA_SET_MARK
        LC_UAPI_LINUX_MOUNT_H
        LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
-       LC_REPLACE_EXCEPTIONAL_ENTRIES
 
        # 5.1
        LC_HAS_LINUX_SELINUX_ENABLED
@@ -2577,6 +2674,9 @@ ext2fs.h not found. Please install e2fsprogs development package.
        ])
 ])
 
+# lustre/tests/statx_test.c
+AC_CHECK_FUNCS([statx])
+
 # lustre/utils/lfs.c
 AS_IF([test "$enable_dist" = "no"], [
                AC_CHECK_LIB([z], [crc32], [
@@ -2607,6 +2707,8 @@ No selinux package found, unable to build selinux enabled tools
 ])
 AC_SUBST(SELINUX)
 
+AC_CHECK_LIB([keyutils], [add_key])
+
 # Super safe df
 AC_MSG_CHECKING([whether to report minimum OST free space])
 AC_ARG_ENABLE([mindf],
@@ -2683,7 +2785,7 @@ AC_ARG_WITH([bash-completion-dir],
 AS_IF([test "x$with_bash_completion_dir" = "xyes"], [
        BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
        AS_IF([test "x$BASH_COMPLETION_DIR" = "x"], [
-               [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]
+               [BASH_COMPLETION_DIR="/usr/share/bash-completion/completions"]
        ])
 ], [
        BASH_COMPLETION_DIR="$with_bash_completion_dir"
@@ -2714,6 +2816,7 @@ AM_CONDITIONAL(XATTR_HANDLER, test "x$lb_cv_compile_xattr_handler_flags" = xyes)
 AM_CONDITIONAL(SELINUX, test "$SELINUX" = "-lselinux")
 AM_CONDITIONAL(GETSEPOL, test x$enable_getsepol = xyes)
 AM_CONDITIONAL(LLCRYPT, test x$enable_llcrypt = xyes)
+AM_CONDITIONAL(LIBAIO, test x$enable_libaio = xyes)
 ]) # LC_CONDITIONALS
 
 #
@@ -2733,21 +2836,18 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/lustre/Makefile
 lustre/include/uapi/linux/lustre/Makefile
+lustre/kernel_patches/targets/4.18-rhel8.2.target
 lustre/kernel_patches/targets/4.18-rhel8.1.target
 lustre/kernel_patches/targets/4.18-rhel8.target
+lustre/kernel_patches/targets/3.10-rhel7.9.target
 lustre/kernel_patches/targets/3.10-rhel7.8.target
 lustre/kernel_patches/targets/3.10-rhel7.7.target
 lustre/kernel_patches/targets/3.10-rhel7.6.target
 lustre/kernel_patches/targets/3.10-rhel7.5.target
 lustre/kernel_patches/targets/4.14-rhel7.5.target
 lustre/kernel_patches/targets/4.14-rhel7.6.target
-lustre/kernel_patches/targets/3.0-sles11.target
-lustre/kernel_patches/targets/3.0-sles11sp3.target
-lustre/kernel_patches/targets/3.0-sles11sp4.target
-lustre/kernel_patches/targets/3.12-sles12.target
-lustre/kernel_patches/targets/4.4-sles12.target
-lustre/kernel_patches/targets/4.4-sles12sp3.target
 lustre/kernel_patches/targets/4.12-sles12sp4.target
+lustre/kernel_patches/targets/4.12-sles12sp5.target
 lustre/kernel_patches/targets/4.12-sles15sp1.target
 lustre/kernel_patches/targets/3.x-fc18.target
 lustre/ldlm/Makefile