Whamcloud - gitweb
LU-8056 llite: inode_operations interface changed in 4.5
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 670389e..365727e 100644 (file)
@@ -215,20 +215,6 @@ LB_CHECK_EXPORT([delete_from_page_cache], [mm/filemap.c],
 ]) # LC_EXPORT_TRUNCATE_COMPLETE_PAGE
 
 #
-# LC_CONFIG_RMTCLIENT
-#
-dnl FIXME
-dnl the AES symbol usually tied with arch, e.g. CRYPTO_AES_586
-dnl FIXME
-AC_DEFUN([LC_CONFIG_RMTCLIENT], [
-LB_CHECK_CONFIG_IM([CRYPTO_AES], [],
-       [AC_MSG_WARN([
-
-Lustre remote client require that CONFIG_CRYPTO_AES is enabled in your kernel.
-])])
-]) # LC_CONFIG_RMTCLIENT
-
-#
 # LC_CONFIG_GSS_KEYRING
 #
 # default 'auto', tests for dependencies, if found, enables;
@@ -244,17 +230,11 @@ AC_MSG_RESULT([$enable_gss_keyring])
 AS_IF([test "x$enable_gss_keyring" != xno], [
        LB_CHECK_CONFIG_IM([KEYS], [], [
                gss_keyring_conf_test="fail"
-               AC_MSG_WARN([
-
-GSS keyring backend require that CONFIG_KEYS be enabled in your kernel.
-])])
+               AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
 
        AC_CHECK_LIB([keyutils], [keyctl_search], [], [
                gss_keyring_conf_test="fail"
-               AC_MSG_WARN([
-
-libkeyutils is not found, which is required by gss keyring backend
-])])
+               AC_MSG_WARN([GSS keyring backend requires libkeyutils])])
 
        AS_IF([test "x$gss_keyring_conf_test" != xfail], [
                AC_DEFINE([HAVE_GSS_KEYRING], [1],
@@ -262,15 +242,7 @@ libkeyutils is not found, which is required by gss keyring backend
                enable_gss_keyring="yes"
        ], [
                AS_IF([test "x$enable_gss_keyring" = xyes], [
-                       AC_MSG_ERROR([
-
-Cannot enable gss_keyring. See above for details.
-])
-               ], [
-                       AC_MSG_WARN([
-
-Cannot enable gss keyring. See above for details.
-])
+                       AC_MSG_ERROR([Cannot enable gss_keyring. See above for details.])
                ])
        ])
 ])
@@ -330,9 +302,9 @@ kernel SUNRPC support is required by using GSS.
 # parts are depend on linux platform.
 #
 AC_DEFUN([LC_CONFIG_GSS], [
-AC_MSG_CHECKING([whether to enable gss/krb5 support])
+AC_MSG_CHECKING([whether to enable gss support])
 AC_ARG_ENABLE([gss],
-       [AC_HELP_STRING([--enable-gss], [enable gss/krb5 support])],
+       [AC_HELP_STRING([--enable-gss], [enable gss support])],
        [], [enable_gss="auto"])
 AC_MSG_RESULT([$enable_gss])
 
@@ -360,7 +332,6 @@ AS_IF([test "x$enable_gss" != xno], [
        AS_IF([test -n "$KRBDIR"], [
                gss_conf_test="success"
        ], [
-               AC_MSG_WARN([not found!])
                gss_conf_test="failure"
        ])
 
@@ -373,7 +344,25 @@ AS_IF([test "x$enable_gss" != xno], [
 ])
 ]) # LC_CONFIG_GSS
 
+# LC_HAVE_VOID_OPENSSL_HMAC_FUNCS
 #
+# OpenSSL 1.0+ return int for HMAC functions but previous versions do not
+AC_DEFUN([LC_HAVE_VOID_OPENSSL_HMAC_FUNCS], [
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+       #include <openssl/hmac.h>
+       #include <openssl/evp.h>
+
+       int main(void) {
+               int rc;
+               HMAC_CTX ctx;
+               HMAC_CTX_init(&ctx);
+               rc = HMAC_Init_ex(&ctx, "test", 4, EVP_md_null(), NULL);
+       }
+])],[],[AC_DEFINE(HAVE_VOID_OPENSSL_HMAC_FUNCS, 1,
+               [OpenSSL HMAC functions return void instead of int])
+])
+]) # LC_HAVE_VOID_OPENSSL_HMAC_FUNCS
+
 # LC_INODE_PERMISION_2ARGS
 #
 # up to v2.6.27 had a 3 arg version (inode, mask, nameidata)
@@ -1260,6 +1249,23 @@ inode_ops_atomic_open, [
 ]) # LC_HAVE_IOP_ATOMIC_OPEN
 
 #
+# LC_HAVE_SB_START_WRITE
+#
+# RHEL6 2.6.32, 3.6 or newer support wrapped FS freeze functions
+#
+AC_DEFUN([LC_HAVE_SB_START_WRITE], [
+LB_CHECK_COMPILE([if kernel supports wrapped FS freeze functions],
+sb_start_write, [
+       #include <linux/fs.h>
+],[
+       sb_start_write(NULL);
+],[
+       AC_DEFINE(HAVE_SB_START_WRITE, 1,
+               [kernel supports wrapped FS freeze functions])
+])
+]) # LC_HAVE_SB_START_WRITE
+
+#
 # LC_HAVE_POSIXACL_USER_NS
 #
 # 3.7 posix_acl_{to,from}_xattr take struct user_namespace
@@ -1295,6 +1301,23 @@ file_f_inode, [
 ]) # LC_HAVE_FILE_F_INODE
 
 #
+# LC_HAVE_FILE_INODE
+#
+# 3.8 has introduced inline function file_inode
+#
+AC_DEFUN([LC_HAVE_FILE_INODE], [
+LB_CHECK_COMPILE([if file_inode() exists],
+file_inode, [
+       #include <linux/fs.h>
+],[
+       file_inode(NULL);
+],[
+       AC_DEFINE(HAVE_FILE_INODE, 1,
+               [file_inode() has been defined])
+])
+]) # LC_HAVE_FILE_INODE
+
+#
 # LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
 #
 AC_DEFUN([LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS], [
@@ -1702,6 +1725,29 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_HAVE_IOV_ITER_INIT_DIRECTION
 
 #
+# LC_HAVE_IOV_ITER_TRUNCATE
+#
+#
+# 3.16 introduces a new API iov_iter_truncate()
+#
+AC_DEFUN([LC_HAVE_IOV_ITER_TRUNCATE], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if 'iov_iter_truncate' exists ],
+iter_truncate, [
+       #include <linux/uio.h>
+       #include <linux/fs.h>
+],[
+       struct iov_iter *i = NULL;
+
+       iov_iter_truncate(i, 0);
+],[
+       AC_DEFINE(HAVE_IOV_ITER_TRUNCATE, 1, [iov_iter_truncate exists])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_HAVE_IOV_ITER_TRUNCATE
+
+#
 # LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
 #
 # 3.16 introduces [read|write]_iter to struct file_operations
@@ -2045,6 +2091,59 @@ key_payload_data_array, [
 ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
 
 #
+# LC_HAVE_FILE_DENTRY
+#
+# 4.5 adds wrapper file_dentry
+#
+AC_DEFUN([LC_HAVE_FILE_DENTRY], [
+LB_CHECK_COMPILE([if Linux kernel has 'file_dentry'],
+file_dentry, [
+       #include <linux/fs.h>
+],[
+       file_dentry(NULL);
+], [
+       AC_DEFINE(HAVE_FILE_DENTRY, 1,
+               [kernel has 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_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2060,8 +2159,8 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_LLITE_LLOOP_MODULE
 
        LC_GLIBC_SUPPORT_FHANDLES
-       LC_CONFIG_RMTCLIENT
        LC_CONFIG_GSS
+       LC_HAVE_VOID_OPENSSL_HMAC_FUNCS
 
        # 2.6.32
        LC_BLK_QUEUE_MAX_SEGMENTS
@@ -2135,12 +2234,14 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_DATA_FOR_LLITE_IS_LIST
        LC_DENTRY_OPEN_USE_PATH
        LC_HAVE_IOP_ATOMIC_OPEN
+       LC_HAVE_SB_START_WRITE
 
        # 3.7
        LC_HAVE_POSIXACL_USER_NS
 
        # 3.8
        LC_HAVE_FILE_F_INODE
+       LC_HAVE_FILE_INODE
        LC_HAVE_SUNRPC_UPCALL_HAS_3ARGS
 
        # 3.9
@@ -2178,6 +2279,7 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 3.16
        LC_DIRECTIO_USE_ITER
        LC_HAVE_IOV_ITER_INIT_DIRECTION
+       LC_HAVE_IOV_ITER_TRUNCATE
        LC_HAVE_FILE_OPERATIONS_READ_WRITE_ITER
 
        # 3.17
@@ -2214,6 +2316,13 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_HAVE_QC_MAKE_REQUEST_FN
        LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
 
+       # 4.5
+       LC_HAVE_FILE_DENTRY
+
+       # 4.5
+       LC_HAVE_INODE_LOCK
+       LC_HAVE_IOP_GET_LINK
+
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_FUNC_DEV_SET_RDONLY
@@ -2525,6 +2634,7 @@ lustre/doc/Makefile
 lustre/include/Makefile
 lustre/include/lustre/Makefile
 lustre/kernel_patches/targets/3.10-rhel7.target
+lustre/kernel_patches/targets/2.6-rhel6.8.target
 lustre/kernel_patches/targets/2.6-rhel6.7.target
 lustre/kernel_patches/targets/2.6-rhel6.6.target
 lustre/kernel_patches/targets/2.6-rhel6.target