Whamcloud - gitweb
LU-11085 nodemap: switch interval tree to in-kernel impl.
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 436737b..09e256a 100644 (file)
@@ -387,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, [
@@ -989,6 +996,23 @@ aio_complete, [
 ]) # LC_HAVE_AIO_COMPLETE
 
 #
+# LC_HAVE_IS_ROOT_INODE
+#
+# 3.19 kernel adds is_root_inode()
+# Commit a7400222e3eb ("new helper: is_root_inode()")
+#
+AC_DEFUN([LC_HAVE_IS_ROOT_INODE], [
+LB_CHECK_COMPILE([if kernel has is_root_inode() ],
+is_root_inode, [
+       #include <linux/fs.h>
+],[
+       is_root_inode(NULL);
+],[
+       AC_DEFINE(HAVE_IS_ROOT_INODE, 1, [is_root_inode defined])
+])
+]) # LC_HAVE_IS_ROOT_INODE
+
+#
 # LC_BACKING_DEV_INFO_REMOVAL
 #
 # 3.20 kernel removed backing_dev_info from address_space
@@ -1136,6 +1160,24 @@ account_page_dirtied, [
 ]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
 
 #
+# LC_HAVE_CRYPTO_ALLOC_SKCIPHER
+#
+# Kernel version 4.12 commit 7a7ffe65c8c5
+# introduced crypto_alloc_skcipher().
+#
+AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
+LB_CHECK_COMPILE([if crypto_alloc_skcipher is defined],
+crypto_alloc_skcipher, [
+       #include <crypto/skcipher.h>
+],[
+       crypto_alloc_skcipher(NULL, 0, 0);
+],[
+       AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
+               [crypto_alloc_skcipher is defined])
+])
+]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
+
+#
 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
 #
 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
@@ -1280,8 +1322,7 @@ LB_CHECK_COMPILE([if kernel has clean_bdev_aliases],
 have_clean_bdev_aliases, [
        #include <linux/buffer_head.h>
 ],[
-       struct block_device bdev;
-       clean_bdev_aliases(&bdev,1,1);
+       clean_bdev_aliases(NULL,1,1);
 ], [
        AC_DEFINE(HAVE_CLEAN_BDEV_ALIASES, 1,
                [kernel has clean_bdev_aliases])
@@ -1540,6 +1581,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
@@ -1935,6 +1989,33 @@ bi_bdev, [
 ]) # LC_BI_BDEV
 
 #
+# LC_INTERVAL_TREE_CACHED
+#
+# 4.14 f808c13fd3738948e10196496959871130612b61
+# switched INTERVAL_TREE_DEFINE to use cached RB_Trees.
+#
+AC_DEFUN([LC_INTERVAL_TREE_CACHED], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if interval_trees use rb_tree_cached],
+itree_cached, [
+       #include <linux/interval_tree_generic.h>
+       struct foo { struct rb_node rb; int last; int a,b;};
+       #define START(n) ((n)->a)
+       #define LAST(n) ((n)->b)
+       struct rb_root_cached tree;
+       INTERVAL_TREE_DEFINE(struct foo, rb, int, last,
+               START, LAST, , foo);
+],[
+       foo_insert(NULL, &tree);
+],[
+       AC_DEFINE(HAVE_INTERVAL_TREE_CACHED, 1,
+               [interval trees use rb_tree_cached])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_INTERVAL_TREE_CACHED
+
+#
 # LC_IS_ENCRYPTED
 #
 # 4.14 introduced IS_ENCRYPTED and S_ENCRYPTED
@@ -1990,6 +2071,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
@@ -2004,6 +2106,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"
@@ -2012,9 +2117,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,
@@ -2227,7 +2332,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
 
@@ -2302,6 +2413,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_KIOCB_HAS_NBYTES
        LC_HAVE_DQUOT_QC_DQBLK
        LC_HAVE_AIO_COMPLETE
+       LC_HAVE_IS_ROOT_INODE
 
        # 3.20
        LC_BACKING_DEV_INFO_REMOVAL
@@ -2316,6 +2428,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_BIO_ENDIO_USES_ONE_ARG
        LC_SYMLINK_OPS_USE_NAMEIDATA
        LC_ACCOUNT_PAGE_DIRTIED_3ARGS
+       LC_HAVE_CRYPTO_ALLOC_SKCIPHER
 
        # 4.3
        LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
@@ -2350,6 +2463,7 @@ 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
@@ -2383,9 +2497,11 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.14
        LC_PAGEVEC_INIT_ONE_PARAM
        LC_BI_BDEV
+       LC_INTERVAL_TREE_CACHED
 
        # 4.17
        LC_VM_FAULT_T
+       LC_VM_FAULT_RETRY
        LC_I_PAGES
 
        # 4.18
@@ -2733,7 +2849,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"
@@ -2764,6 +2880,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
 
 #
@@ -2783,9 +2900,11 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/lustre/Makefile
 lustre/include/uapi/linux/lustre/Makefile
+lustre/kernel_patches/targets/4.18-rhel8.3.target
 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
@@ -2793,7 +2912,9 @@ 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/4.12-sles12sp4.target
+lustre/kernel_patches/targets/4.12-sles12sp5.target
 lustre/kernel_patches/targets/4.12-sles15sp1.target
+lustre/kernel_patches/targets/4.12-sles15sp2.target
 lustre/kernel_patches/targets/3.x-fc18.target
 lustre/ldlm/Makefile
 lustre/fid/Makefile