Whamcloud - gitweb
LU-14651 llite: extend inode methods with user namespace arg
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 66d5256..8a66bd9 100644 (file)
@@ -1353,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
 #
@@ -1875,8 +1897,8 @@ LB_CHECK_COMPILE([if 'struct vm_fault' replaced virtual_address with address fie
 vm_fault_address, [
        #include <linux/mm.h>
 ],[
-       struct vm_fault vmf;
-       vmf.address = NULL;
+       unsigned long vaddr = ((struct vm_fault *)0)->address;
+       (void)vaddr;
 ],[
        AC_DEFINE(HAVE_VM_FAULT_ADDRESS, 1,
                [virtual_address has been replaced by address field])
@@ -2191,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
@@ -2415,9 +2457,6 @@ 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
 #
@@ -2436,6 +2475,32 @@ fscrypt_support, [
 ]) # LC_FSCRYPT_SUPPORT
 
 #
+# LC_HAVE_USER_NAMESPACE_ARG
+#
+# kernel 5.12 commit 549c7297717c32ee53f156cd949e055e601f67bb
+# fs: make helpers idmap mount aware
+# Extend some inode methods with an additional user namespace argument.
+#
+AC_DEFUN([LC_HAVE_USER_NAMESPACE_ARG], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'inode_operations' members have user namespace argument],
+user_namespace_argument, [
+       #include <linux/fs.h>
+],[
+       ((struct inode_operations *)1)->getattr((struct user_namespace *)NULL,
+                                               NULL, NULL, 0, 0);
+],[
+       AC_DEFINE(HAVE_USER_NAMESPACE_ARG, 1,
+               ['inode_operations' members have user namespace argument])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_HAVE_USER_NAMESPACE_ARG
+
+AC_DEFUN([LC_PROG_LINUX_SRC], [])
+AC_DEFUN([LC_PROG_LINUX_RESULTS], [])
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2583,6 +2648,7 @@ 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
@@ -2596,6 +2662,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_I_PAGES
 
        # 4.18
+       LC_ALLOC_FILE_PSEUDO
        LC_INODE_TIMESPEC64
 
        # 4.20
@@ -2615,6 +2682,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_BIO_BI_PHYS_SEGMENTS
        LC_LM_COMPARE_OWNER_EXISTS
 
+       # 5.12
+       LC_HAVE_USER_NAMESPACE_ARG
+
        # kernel patch to extend integrity interface
        LC_BIO_INTEGRITY_PREP_FN
 
@@ -2993,6 +3063,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
@@ -3008,7 +3079,7 @@ 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/5.3-sles15sp2.target
 lustre/kernel_patches/targets/5.3-sles15sp3.target
 lustre/kernel_patches/targets/3.x-fc18.target
 lustre/ldlm/Makefile