Whamcloud - gitweb
LU-12634 gss: uid_keyring and session_keyring moved
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 28e2b80..c6b5821 100644 (file)
@@ -181,6 +181,22 @@ Lustre quota requires that CONFIG_QUOTA is enabled in your kernel.
 ])])
 ]) # LC_QUOTA_CONFIG
 
+
+#[AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])])
+#
+# LC_POSIX_ACL_CONFIG
+#
+# POSIX ACL support.
+#
+AC_DEFUN([LC_POSIX_ACL_CONFIG], [
+LB_CHECK_CONFIG_IM([FS_POSIX_ACL],
+       [AC_DEFINE(CONFIG_LUSTRE_FS_POSIX_ACL, 1, [Enable POSIX acl])
+], [ ])
+]) # LC_POSIX_ACL_CONFIG
+
+LB_CHECK_CONFIG_IM([CRYPTO_MD5], [],
+               [AC_MSG_WARN([kernel MD5 support is recommended by using GSS.])])
+
 #
 # LC_CONFIG_GSS_KEYRING
 #
@@ -216,23 +232,6 @@ AS_IF([test "x$enable_gss_keyring" != xno], [
 ]) # LC_CONFIG_GSS_KEYRING
 
 #
-# LC_HAVE_CRED_TGCRED
-#
-# rhel7 struct cred has no member tgcred
-#
-AC_DEFUN([LC_HAVE_CRED_TGCRED], [
-LB_CHECK_COMPILE([if 'struct cred' has member 'tgcred'],
-cred_tgcred, [
-       #include <linux/cred.h>
-],[
-       ((struct cred *)0)->tgcred = NULL;
-],[
-       AC_DEFINE(HAVE_CRED_TGCRED, 1,
-               [struct cred has member tgcred])
-])
-]) # LC_HAVE_CRED_TGCRED
-
-#
 # LC_KEY_TYPE_INSTANTIATE_2ARGS
 #
 # rhel7 key_type->instantiate takes 2 args (struct key, struct key_preparsed_payload)
@@ -277,7 +276,6 @@ AC_MSG_RESULT([$enable_gss])
 
 AS_IF([test "x$enable_gss" != xno], [
        LC_CONFIG_GSS_KEYRING
-       LC_HAVE_CRED_TGCRED
        LC_KEY_TYPE_INSTANTIATE_2ARGS
        sunrpc_required=$enable_gss
        LC_CONFIG_SUNRPC
@@ -1858,6 +1856,23 @@ bio_endio, [
 ]) # LC_BIO_ENDIO_USES_ONE_ARG
 
 #
+# LC_ACCOUNT_PAGE_DIRTIED_3ARGS
+#
+# 4.2 [to 4.5] kernel page dirtied takes 3 arguments
+#
+AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED_3ARGS], [
+LB_CHECK_COMPILE([if 'account_page_dirtied' with 3 args exists],
+account_page_dirtied, [
+       #include <linux/mm.h>
+],[
+       account_page_dirtied(NULL, NULL, NULL);
+],[
+       AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED_3ARGS, 1,
+               [account_page_dirtied takes three arguments])
+])
+]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
+
+#
 # LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
 #
 # 4.3 replace interval with interval_exp in 'struct blk_integrity'
@@ -2209,6 +2224,23 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_D_IN_LOOKUP
 
 #
+# LC_LOCK_PAGE_MEMCG
+#
+# Kernel version 4.6 adds lock_page_memcg
+#
+AC_DEFUN([LC_LOCK_PAGE_MEMCG], [
+LB_CHECK_COMPILE([if 'lock_page_memcg' is defined],
+lock_page_memcg, [
+       #include <linux/memcontrol.h>
+],[
+       lock_page_memcg(NULL);
+],[
+       AC_DEFINE(HAVE_LOCK_PAGE_MEMCG, 1,
+               [lock_page_memcg is defined])
+])
+]) # LC_LOCK_PAGE_MEMCG
+
+#
 # LC_DIRECTIO_2ARGS
 #
 # Kernel version 4.7 commit c8b8e32d700fe943a935e435ae251364d016c497
@@ -2255,7 +2287,7 @@ generic_write_sync_2args, [
 #
 # LC_FOP_ITERATE_SHARED
 #
-# Kernel version 4.7 adds iterate_shared method to file_operations
+# Kernel v4.6-rc3-29-g6192269 adds iterate_shared method to file_operations
 #
 AC_DEFUN([LC_FOP_ITERATE_SHARED], [
 LB_CHECK_COMPILE([if 'file_operations' has 'iterate_shared'],
@@ -2271,29 +2303,6 @@ fop_iterate_shared, [
 ]) # LC_FOP_ITERATE_SHARED
 
 #
-# LC_FOPS_ITERATE_SHARED
-#
-# 4.7 commit ae05327a00fd47c34dfe25294b359a3f3fef96e8
-# ext4: switch to ->iterate_shared()
-# this replaces ext4_dir_operations iterate with iterate_shared.
-# dir_relaxed_shared() was also added in this commit, so we can
-# use that function to verify that the ext4_dir_operations is using
-# iterate_shared.
-#
-AC_DEFUN([LC_FOPS_ITERATE_SHARED], [
-LB_CHECK_COMPILE([if ext4_dir_operations uses iterate_shared],
-iterate_shared, [
-       #include <linux/fs.h>
-],[
-       ((struct file_operations *)0)->iterate_shared(NULL, NULL);
-       dir_relax_shared(NULL);
-],[
-       AC_DEFINE(HAVE_ITERATE_SHARED, 1,
-               ['iterate_shared' is available])
-])
-]) # LC_FOPS_ITERATE_SHARED
-
-#
 # LC_HAVE_POSIX_ACL_VALID_USER_NS
 #
 # 4.8 posix_acl_valid takes struct user_namespace
@@ -2638,53 +2647,6 @@ bi_status, [
 ]) # LC_BI_STATUS
 
 #
-# LC_UAPI_LINUX_MOUNT_H
-#
-# kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
-# vfs: Suppress MS_* flag defs within the kernel ...
-#
-AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
-uapi_linux_mount, [
-       #include <uapi/linux/mount.h>
-],[
-       int x = MS_RDONLY;
-       (void)x;
-],[
-       AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
-               [if MS_RDONLY was moved to uapi/linux/mount.h])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_UAPI_LINUX_MOUNT_H
-
-#
-# LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
-#
-# kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
-# SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
-#
-# Now that the reader functions are all RCU protected, use a regular
-# spinlock rather than a reader/writer lock.
-#
-AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
-hash_lock_isa_spinlock_t, [
-       #include <linux/sunrpc/cache.h>
-],[
-       spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
-       spin_lock(lock);
-],[
-       AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
-               [if cache_detail->hash_lock is a spinlock])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
-
-#
 # LC_BIO_INTEGRITY_ENABLED
 #
 # 4.13 removed bio_integrity_enabled
@@ -2796,10 +2758,10 @@ LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
 inode_timespec64, [
        #include <linux/fs.h>
 ],[
-       struct inode inode = {};
+       struct inode *inode = NULL;
        struct timespec64 ts = {};
 
-       inode.i_atime = timespec64_trunc(ts, 1);
+       inode->i_atime = timespec64_trunc(ts, 1);
        (void)inode;
 ],[
        AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
@@ -2809,6 +2771,74 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_INODE_TIMESPEC64
 
 #
+# LC___XA_SET_MARK
+#
+# kernel 4.20 commit v4.19-rc5-248-g9b89a0355144
+# xarray: Add XArray marks
+#
+AC_DEFUN([LC___XA_SET_MARK], [
+LB_CHECK_COMPILE([if '__xa_set_mark' exists],
+__xa_set_mark, [
+       #include <linux/xarray.h>
+       #include <linux/fs.h>
+],[
+       struct xarray *xa = NULL;
+
+       __xa_set_mark(xa, 0, PAGECACHE_TAG_DIRTY);
+],[
+       AC_DEFINE(HAVE___XA_SET_MARK, 1,
+               [__xa_set_mark exists])
+])
+]) # LC___XA_SET_MARK
+
+#
+# LC_UAPI_LINUX_MOUNT_H
+#
+# kernel 4.20 commit e262e32d6bde0f77fb0c95d977482fc872c51996
+# vfs: Suppress MS_* flag defs within the kernel ...
+#
+AC_DEFUN([LC_UAPI_LINUX_MOUNT_H], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if MS_RDONLY was moved to uapi/linux/mount.h],
+uapi_linux_mount, [
+       #include <uapi/linux/mount.h>
+],[
+       int x = MS_RDONLY;
+       (void)x;
+],[
+       AC_DEFINE(HAVE_UAPI_LINUX_MOUNT_H, 1,
+               [if MS_RDONLY was moved to uapi/linux/mount.h])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_UAPI_LINUX_MOUNT_H
+
+#
+# LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
+#
+# kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
+# SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
+#
+# Now that the reader functions are all RCU protected, use a regular
+# spinlock rather than a reader/writer lock.
+#
+AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
+hash_lock_isa_spinlock_t, [
+       #include <linux/sunrpc/cache.h>
+],[
+       spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
+       spin_lock(lock);
+],[
+       AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
+               [if cache_detail->hash_lock is a spinlock])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
+
+#
 # LC_HAS_LINUX_SELINUX_ENABLED
 #
 # kernel 5.1 commit 3d252529480c68bfd6a6774652df7c8968b28e41
@@ -2831,6 +2861,23 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_HAS_LINUX_SELINUX_ENABLED
 
 #
+# LC_ACCOUNT_PAGE_DIRTIED
+#
+# After 5.2 kernel page dirtied is not exported
+#
+AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [
+LB_CHECK_COMPILE([if 'account_page_dirtied' is exported],
+account_page_dirtied, [
+       #include <linux/mm.h>
+],[
+       account_page_dirtied(NULL, NULL);
+],[
+       AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED, 1,
+               [account_page_dirtied is available])
+])
+]) # LC_ACCOUNT_PAGE_DIRTIED
+
+#
 # LC_BIO_BI_PHYS_SEGMENTS
 #
 # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c
@@ -3020,6 +3067,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.2
        LC_BIO_ENDIO_USES_ONE_ARG
        LC_SYMLINK_OPS_USE_NAMEIDATA
+       LC_ACCOUNT_PAGE_DIRTIED_3ARGS
 
        # 4.3
        LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
@@ -3045,12 +3093,13 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.6
        LC_HAVE_IN_COMPAT_SYSCALL
        LC_HAVE_XATTR_HANDLER_INODE_PARAM
+       LC_LOCK_PAGE_MEMCG
 
        # 4.7
        LC_D_IN_LOOKUP
        LC_DIRECTIO_2ARGS
        LC_GENERIC_WRITE_SYNC_2ARGS
-       LC_FOPS_ITERATE_SHARED
+       LC_FOP_ITERATE_SHARED
 
        # 4.8
        LC_HAVE_POSIX_ACL_VALID_USER_NS
@@ -3095,14 +3144,16 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_INODE_TIMESPEC64
 
        # 4.20
-       LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
-
-       # 5.0
+       LC___XA_SET_MARK
        LC_UAPI_LINUX_MOUNT_H
+       LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
 
        # 5.1
        LC_HAS_LINUX_SELINUX_ENABLED
 
+       # 5.2
+       LC_ACCOUNT_PAGE_DIRTIED
+
        # 5.3
        LC_BIO_BI_PHYS_SEGMENTS
        LC_LM_COMPARE_OWNER_EXISTS
@@ -3115,6 +3166,7 @@ AC_DEFUN([LC_PROG_LINUX], [
                LC_STACK_SIZE
                LC_QUOTA_CONFIG
        ])
+       LC_POSIX_ACL_CONFIG
 ]) # LC_PROG_LINUX
 
 #
@@ -3375,6 +3427,23 @@ AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitd
 AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
        [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
 AC_MSG_RESULT([$with_systemdsystemunitdir])
+
+AC_MSG_CHECKING([bash-completion directory])
+AC_ARG_WITH([bash-completion-dir],
+       AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
+               [Install the bash auto-completion script in this directory.]),
+       [],
+       [with_bash_completion_dir=yes])
+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="$with_bash_completion_dir"
+])
+AC_SUBST([BASH_COMPLETION_DIR])
+AC_MSG_RESULT([$BASH_COMPLETION_DIR])
 ]) # LC_CONFIGURE
 
 #
@@ -3394,6 +3463,7 @@ AM_CONDITIONAL(GSS_PIPEFS, test x$enable_gss_pipefs = xyes)
 AM_CONDITIONAL(GSS_SSK, test x$enable_ssk = xyes)
 AM_CONDITIONAL(LIBPTHREAD, test x$enable_libpthread = xyes)
 AM_CONDITIONAL(HAVE_SYSTEMD, test "x$with_systemdsystemunitdir" != "xno")
+AM_CONDITIONAL(ENABLE_BASH_COMPLETION, test "x$with_bash_completion_dir" != "xno")
 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)
@@ -3416,6 +3486,7 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/lustre/Makefile
 lustre/include/uapi/linux/lustre/Makefile
+lustre/kernel_patches/targets/4.18-rhel8.1.target
 lustre/kernel_patches/targets/4.18-rhel8.target
 lustre/kernel_patches/targets/3.10-rhel7.7.target
 lustre/kernel_patches/targets/3.10-rhel7.6.target