Whamcloud - gitweb
LU-9558 llite: handle struct vm_operations changes
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 1cde867..236bd77 100644 (file)
@@ -1771,6 +1771,25 @@ have_bvec_iter, [
 ]) # LC_HAVE_BVEC_ITER
 
 #
+# LC_IOP_SET_ACL
+#
+# 3.14 adds set_acl method to inode_operations
+# see kernel commit 893d46e443346370cd4ea81d9d35f72952c62a37
+#
+AC_DEFUN([LC_IOP_SET_ACL], [
+LB_CHECK_COMPILE([if 'inode_operations' has '.set_acl' member function],
+inode_ops_set_acl, [
+       #include <linux/fs.h>
+],[
+       struct inode_operations iop;
+       iop.set_acl = NULL;
+],[
+       AC_DEFINE(HAVE_IOP_SET_ACL, 1,
+               [inode_operations has .set_acl member function])
+])
+]) # LC_IOP_SET_ACL
+
+#
 # LC_HAVE_BI_CNT
 #
 # 4.4 redefined bi_cnt as __bi_cnt
@@ -2614,6 +2633,29 @@ vm_fault_address, [
 ]) # LC_HAVE_VM_FAULT_ADDRESS
 
 #
+# LC_VM_OPERATIONS_REMOVE_VMF_ARG
+#
+# Kernel version 4.11 commit 11bac80004499ea59f361ef2a5516c84b6eab675
+# removed struct vm_area_struct as an argument for vm_operations since
+# in the same kernel version struct vma_area_struct was folded into
+# struct vm_fault.
+#
+AC_DEFUN([LC_VM_OPERATIONS_REMOVE_VMF_ARG], [
+LB_CHECK_COMPILE([if 'struct vm_operations' removed struct vm_area_struct],
+vm_operations_no_vm_area_struct, [
+       #include <linux/mm.h>
+],[
+       struct vm_fault vmf;
+
+       ((struct vm_operations_struct *)0)->fault(&vmf);
+       ((struct vm_operations_struct *)0)->page_mkwrite(&vmf);
+],[
+       AC_DEFINE(HAVE_VM_OPS_USE_VM_FAULT_ONLY, 1,
+               ['struct vm_operations' remove struct vm_area_struct argument])
+])
+]) # LC_VM_OPERATIONS_REMOVE_VMF_ARG
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2751,6 +2793,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_HAVE_BVEC_ITER
        LC_HAVE_TRUNCATE_IPAGES_FINAL
        LC_IOPS_RENAME_WITH_FLAGS
+       LC_IOP_SET_ACL
 
        # 3.15
        LC_VFS_RENAME_6ARGS
@@ -2828,6 +2871,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_IOP_GENERIC_READLINK
        LC_HAVE_VM_FAULT_ADDRESS
 
+       # 4.11
+       LC_VM_OPERATIONS_REMOVE_VMF_ARG
+
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_STACK_SIZE