Whamcloud - gitweb
LU-8560 llite: handle is_compat_task() rename
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 9d74fcd..3772621 100644 (file)
@@ -1377,6 +1377,22 @@ bio_end_sector, [
 ]) # LC_HAVE_BIO_END_SECTOR
 
 #
+# 3.9 created is_sxid
+#
+AC_DEFUN([LC_HAVE_IS_SXID], [
+LB_CHECK_COMPILE([if 'is_sxid' is defined],
+is_sxid, [
+       #include <linux/fs.h>
+],[
+       struct inode inode;
+
+       is_sxid(inode.i_mode);
+],[
+       AC_DEFINE(HAVE_IS_SXID, 1, [is_sxid is defined])
+])
+]) # LC_HAVE_IS_SXID
+
+#
 # LC_HAVE_REMOVE_PROC_SUBTREE
 #
 # 3.10 introduced remove_proc_subtree
@@ -1431,6 +1447,23 @@ block_device_ops_release_return_int, [
 ]) # LC_BLKDEV_RELEASE_RETURN_INT
 
 #
+# LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
+#
+# 3.10 introduced security_dentry_init_security()
+#
+AC_DEFUN([LC_HAVE_SECURITY_DENTRY_INIT_SECURITY], [
+LB_CHECK_COMPILE([if 'security_dentry_init_security' is defined],
+security_dentry_init_security, [
+       #include <linux/security.h>
+],[
+       security_dentry_init_security(NULL, 0, NULL, NULL, NULL);
+],[
+       AC_DEFINE(HAVE_SECURITY_DENTRY_INIT_SECURITY, 1,
+               [security_dentry_init_security' is defined])
+])
+]) # LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
+
+#
 # LC_INVALIDATE_RANGE
 #
 # 3.11 invalidatepage requires the length of the range to invalidate
@@ -1851,6 +1884,30 @@ ki_nbytes, [
 ]) # LC_KIOCB_HAS_NBYTES
 
 #
+# LC_HAVE_DQUOT_QC_DQBLK
+#
+# 3.19 has quotactl_ops->[sg]et_dqblk that take struct kqid and qc_dqblk
+# Added in commit 14bf61ffe
+#
+AC_DEFUN([LC_HAVE_DQUOT_QC_DQBLK], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'quotactl_ops.set_dqblk' takes struct qc_dqblk],
+qc_dqblk, [
+       #include <linux/fs.h>
+       #include <linux/quota.h>
+],[
+       ((struct quotactl_ops *)0)->set_dqblk(NULL, *((struct kqid*)0), (struct qc_dqblk*)0);
+],[
+       AC_DEFINE(HAVE_DQUOT_QC_DQBLK, 1,
+               [quotactl_ops.set_dqblk takes struct qc_dqblk])
+       AC_DEFINE(HAVE_DQUOT_KQID, 1,
+               [quotactl_ops.set_dqblk takes struct kqid])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_HAVE_DQUOT_QC_DQBLK
+
+#
 # LC_BACKING_DEV_INFO_REMOVAL
 #
 # 3.20 kernel removed backing_dev_info from address_space
@@ -2108,6 +2165,59 @@ file_dentry, [
 ]) # LC_HAVE_FILE_DENTRY
 
 #
+# LC_HAVE_INODE_LOCK
+#
+# 4.5 introduced inode_lock
+#
+AC_DEFUN([LC_HAVE_INODE_LOCK], [
+LB_CHECK_COMPILE([if 'inode_lock' is defined],
+inode_lock, [
+       #include <linux/fs.h>
+],[
+       inode_lock(NULL);
+], [
+       AC_DEFINE(HAVE_INODE_LOCK, 1,
+                 [inode_lock is defined])
+])
+]) # LC_HAVE_INODE_LOCK
+
+#
+# LC_HAVE_IOP_GET_LINK
+#
+# 4.5 vfs replaced iop->follow_link with
+# iop->get_link
+#
+AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
+LB_CHECK_COMPILE([if 'iop' has 'get_link'],
+inode_ops_get_link, [
+       #include <linux/fs.h>
+],[
+       struct inode_operations iop;
+       iop.get_link = NULL;
+],[
+       AC_DEFINE(HAVE_IOP_GET_LINK, 1,
+               [have iop get_link])
+])
+]) # LC_HAVE_IOP_GET_LINK
+
+#
+# LC_HAVE_IN_COMPAT_SYSCALL
+#
+# 4.6 renamed is_compat_task to in_compat_syscall
+#
+AC_DEFUN([LC_HAVE_IN_COMPAT_SYSCALL], [
+LB_CHECK_COMPILE([if 'in_compat_syscall' is defined],
+in_compat_syscall, [
+       #include <linux/compat.h>
+],[
+       in_compat_syscall();
+],[
+       AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
+               [have in_compat_syscall])
+])
+]) # LC_HAVE_IN_COMPAT_SYSCALL
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2211,11 +2321,13 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 3.9
        LC_HAVE_HLIST_FOR_EACH_3ARG
        LC_HAVE_BIO_END_SECTOR
+       LC_HAVE_IS_SXID
 
        # 3.10
        LC_BLKDEV_RELEASE_RETURN_INT
        LC_HAVE_REMOVE_PROC_SUBTREE
        LC_HAVE_PROC_REMOVE
+       LC_HAVE_SECURITY_DENTRY_INIT_SECURITY
 
        # 3.11
        LC_INVALIDATE_RANGE
@@ -2255,6 +2367,7 @@ AC_DEFUN([LC_PROG_LINUX], [
 
        # 3.19
        LC_KIOCB_HAS_NBYTES
+       LC_HAVE_DQUOT_QC_DQBLK
 
        # 3.20
        LC_BACKING_DEV_INFO_REMOVAL
@@ -2283,6 +2396,13 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.5
        LC_HAVE_FILE_DENTRY
 
+       # 4.5
+       LC_HAVE_INODE_LOCK
+       LC_HAVE_IOP_GET_LINK
+
+       # 4.6
+       LC_HAVE_IN_COMPAT_SYSCALL
+
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_FUNC_DEV_SET_RDONLY