Whamcloud - gitweb
LU-13783 osd-ldiskfs: use alloc_file_pseudo to create fake files
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 026f650..659beb9 100644 (file)
@@ -268,7 +268,9 @@ AC_MSG_CHECKING([whether to enable gss keyring backend])
 AC_ARG_ENABLE([gss_keyring],
        [AC_HELP_STRING([--disable-gss-keyring],
                [disable gss keyring backend])],
-       [], [enable_gss_keyring="auto"])
+       [], [AS_IF([test "x$enable_gss" != xno], [
+                       enable_gss_keyring="yes"], [
+                       enable_gss_keyring="auto"])])
 AC_MSG_RESULT([$enable_gss_keyring])
 AS_IF([test "x$enable_gss_keyring" != xno], [
        LB_CHECK_CONFIG_IM([KEYS], [], [
@@ -287,7 +289,10 @@ AS_IF([test "x$enable_gss_keyring" != xno], [
                AS_IF([test "x$enable_gss_keyring" = xyes], [
                        AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
                ])
+               enable_ssk="no"
        ])
+], [
+       enable_ssk="no"
 ])
 ]) # LC_CONFIG_GSS_KEYRING
 
@@ -380,7 +385,9 @@ AS_IF([test "x$enable_gss" != xno], [
                enable_gss="no"
        ])
 
-       enable_ssk=$enable_gss
+       AS_IF([test "x$enable_ssk" != xno], [
+               enable_ssk=$enable_gss
+       ])
 ], [
        enable_gss_keyring="no"
 ])
@@ -454,6 +461,21 @@ get_projid, [
 ])
 ]) # LC_HAVE_PROJECT_QUOTA
 
+AC_DEFUN([LC_HAVE_GET_INODE_USAGE], [
+LB_CHECK_COMPILE([if get_inode_usage exists],
+get_inode_usage, [
+       struct inode;
+       #include <linux/quota.h>
+],[
+       struct dquot_operations ops = { };
+
+       ops.get_inode_usage(NULL, NULL);
+],[
+       AC_DEFINE(HAVE_GET_INODE_USAGE, 1,
+               [get_inode_usage function exists])
+])
+]) # LC_HAVE_GET_INODE_USAGE
+
 #
 # LC_INVALIDATE_RANGE
 #
@@ -1331,6 +1353,28 @@ bio_integrity_prep_fn, [
 ])
 ]) # LC_BIO_INTEGRITY_PREP_FN
 
+# LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
+#
+# 13 kernel integrity API has changed and in 4.13+
+# (as well as in rhel 8.4) bio_integrity_prep() returns boolean true
+# on success.
+#
+AC_DEFUN([LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL], [
+LB_CHECK_COMPILE([if 'bio_integrity_prep_fn' returns bool],
+bio_integrity_prep, [
+       #include <linux/bio.h>
+       #include <linux/typecheck.h>
+],[
+       #pragma GCC diagnostic warning "-Werror"
+       typedef bool (*bio_integrity_prep_type)(struct bio *bio) ;
+
+       typecheck_fn(bio_integrity_prep_type, bio_integrity_prep);
+],[
+       AC_DEFINE(HAVE_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL, 1,
+               [bio_integrity_prep_fn returns bool])
+])
+]) # LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
+
 #
 # LC_HAVE_BI_OPF
 #
@@ -2169,6 +2213,26 @@ VM_FAULT_RETRY, [
 ]) # LC_VM_FAULT_RETRY
 
 #
+# LC_ALLOC_FILE_PSEUDO
+#
+# kernel 4.18-rc1 commit d93aa9d82aea80b80f225dbf9c7986df444d8106
+# new wrapper: alloc_file_pseudo()
+#
+AC_DEFUN([LC_ALLOC_FILE_PSEUDO], [
+LB_CHECK_COMPILE([if 'alloc_file_pseudo' is defined],
+alloc_file_pseudo, [
+       #include <linux/file.h>
+],[
+       struct file *file;
+       file = alloc_file_pseudo(NULL, NULL, "[test]",
+                                00000002, NULL);
+],[
+       AC_DEFINE(HAVE_ALLOC_FILE_PSEUDO, 1,
+               ['alloc_file_pseudo' exist])
+])
+]) # LC_ALLOC_FILE_PSEUDO
+
+#
 # LC_INODE_TIMESPEC64
 #
 # kernel 4.17-rc7 commit 8efd6894ff089adeeac7cb9f32125b85d963d1bc
@@ -2561,6 +2625,8 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 4.13
        LC_BIO_INTEGRITY_ENABLED
+       LC_BIO_INTEGRITY_PREP_FN_RETURNS_BOOL
+       LC_HAVE_GET_INODE_USAGE
 
        # 4.14
        LC_PAGEVEC_INIT_ONE_PARAM
@@ -2573,6 +2639,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_I_PAGES
 
        # 4.18
+       LC_ALLOC_FILE_PSEUDO
        LC_INODE_TIMESPEC64
 
        # 4.20
@@ -2970,6 +3037,7 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/lustre/Makefile
 lustre/include/uapi/linux/lustre/Makefile
+lustre/kernel_patches/targets/4.18-rhel8.5.target
 lustre/kernel_patches/targets/4.18-rhel8.4.target
 lustre/kernel_patches/targets/4.18-rhel8.3.target
 lustre/kernel_patches/targets/4.18-rhel8.2.target