Merge dc705e83f0
into 1713aa7b4d
This commit is contained in:
commit
8d343173bf
2
META
2
META
|
@ -7,4 +7,4 @@ Release-Tags: relext
|
|||
License: CDDL
|
||||
Author: OpenZFS
|
||||
Linux-Maximum: 6.10
|
||||
Linux-Minimum: 3.10
|
||||
Linux-Minimum: 4.18
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
# intlmacosx.m4 serial 6 (gettext-0.20)
|
||||
dnl Copyright (C) 2004-2014, 2016, 2019 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
dnl
|
||||
dnl This file can be used in projects which are not available under
|
||||
dnl the GNU General Public License or the GNU Library General Public
|
||||
dnl License but which still want to provide support for the GNU gettext
|
||||
dnl functionality.
|
||||
dnl Please note that the actual code of the GNU gettext library is covered
|
||||
dnl by the GNU Library General Public License, and the rest of the GNU
|
||||
dnl gettext package is covered by the GNU General Public License.
|
||||
dnl They are *not* in the public domain.
|
||||
|
||||
dnl Checks for special options needed on Mac OS X.
|
||||
dnl Defines INTL_MACOSX_LIBS.
|
||||
AC_DEFUN([gt_INTL_MACOSX],
|
||||
[
|
||||
dnl Check for API introduced in Mac OS X 10.4.
|
||||
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue],
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <CoreFoundation/CFPreferences.h>]],
|
||||
[[CFPreferencesCopyAppValue(NULL, NULL)]])],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=yes],
|
||||
[gt_cv_func_CFPreferencesCopyAppValue=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
|
||||
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
|
||||
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
|
||||
fi
|
||||
dnl Check for API introduced in Mac OS X 10.5.
|
||||
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <CoreFoundation/CFLocale.h>]],
|
||||
[[CFLocaleCopyCurrent();]])],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=yes],
|
||||
[gt_cv_func_CFLocaleCopyCurrent=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
|
||||
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
|
||||
[Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
|
||||
fi
|
||||
AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
|
||||
[gt_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <CoreFoundation/CFLocale.h>]],
|
||||
[[CFLocaleCopyPreferredLanguages();]])],
|
||||
[gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
|
||||
[gt_cv_func_CFLocaleCopyPreferredLanguages=no])
|
||||
LIBS="$gt_save_LIBS"])
|
||||
if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
|
||||
AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
|
||||
[Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
|
||||
fi
|
||||
INTL_MACOSX_LIBS=
|
||||
if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
|
||||
|| test $gt_cv_func_CFLocaleCopyCurrent = yes \
|
||||
|| test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
|
||||
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
|
||||
fi
|
||||
AC_SUBST([INTL_MACOSX_LIBS])
|
||||
])
|
|
@ -1,112 +1,3 @@
|
|||
dnl #
|
||||
dnl # Check if posix_acl_release can be used from a ZFS_META_LICENSED
|
||||
dnl # module. The is_owner_or_cap macro was replaced by
|
||||
dnl # inode_owner_or_capable
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_release], [
|
||||
#include <linux/cred.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
], [
|
||||
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
||||
posix_acl_release(tmp);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
||||
AC_MSG_CHECKING([whether posix_acl_release() is available])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_release], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_RELEASE, 1,
|
||||
[posix_acl_release() is available])
|
||||
|
||||
AC_MSG_CHECKING([whether posix_acl_release() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_release_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_RELEASE_GPL_ONLY, 1,
|
||||
[posix_acl_release() is GPL-only])
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # set_cached_acl() and forget_cached_acl() changed from inline to
|
||||
dnl # EXPORT_SYMBOL. In the former case, they may not be usable because of
|
||||
dnl # posix_acl_release. In the latter case, we can always use them.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [
|
||||
ZFS_LINUX_TEST_SRC([set_cached_acl], [
|
||||
#include <linux/cred.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
], [
|
||||
struct inode *ip = NULL;
|
||||
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
||||
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
||||
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
||||
AC_MSG_CHECKING([whether set_cached_acl() is usable])
|
||||
ZFS_LINUX_TEST_RESULT([set_cached_acl_license], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_CACHED_ACL_USABLE, 1,
|
||||
[set_cached_acl() is usable])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.1 API change,
|
||||
dnl # posix_acl_chmod() was added as the preferred interface.
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # posix_acl_chmod() was changed to __posix_acl_chmod()
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_chmod], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
posix_acl_chmod(NULL, 0, 0)
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([__posix_acl_chmod], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
__posix_acl_chmod(NULL, 0, 0)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
|
||||
AC_MSG_CHECKING([whether __posix_acl_chmod exists])
|
||||
ZFS_LINUX_TEST_RESULT([__posix_acl_chmod], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1,
|
||||
[__posix_acl_chmod() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether posix_acl_chmod exists])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1,
|
||||
[posix_acl_chmod() exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([posix_acl_chmod()])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.1 API change,
|
||||
dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t
|
||||
|
@ -130,34 +21,6 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.8 API change,
|
||||
dnl # The function posix_acl_valid now must be passed a namespace.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_valid_with_ns], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
struct user_namespace *user_ns = NULL;
|
||||
const struct posix_acl *acl = NULL;
|
||||
int error;
|
||||
|
||||
error = posix_acl_valid(user_ns, acl);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
|
||||
AC_MSG_CHECKING([whether posix_acl_valid() wants user namespace])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_valid_with_ns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_VALID_WITH_NS, 1,
|
||||
[posix_acl_valid() wants user namespace])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.1 API change,
|
||||
dnl # Check if inode_operations contains the function get_acl
|
||||
|
@ -226,9 +89,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # Check if inode_operations contains the function set_acl
|
||||
dnl #
|
||||
dnl # 5.12 API change,
|
||||
dnl # set_acl() added a user_namespace* parameter first
|
||||
|
@ -290,106 +150,35 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL], [
|
|||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
|
||||
AC_MSG_CHECKING([whether iops->set_acl() exists])
|
||||
AC_MSG_CHECKING([whether iops->set_acl() with 4 args exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||
AC_DEFINE(HAVE_SET_ACL_USERNS, 1, [iops->set_acl() takes 4 args])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_mnt_idmap_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||
AC_DEFINE(HAVE_SET_ACL_IDMAP_DENTRY, 1,
|
||||
[iops->set_acl() takes 4 args, arg1 is struct mnt_idmap *])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl_userns_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
|
||||
AC_DEFINE(HAVE_SET_ACL_USERNS_DENTRY_ARG2, 1,
|
||||
[iops->set_acl() takes 4 args, arg2 is struct dentry *])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_set_acl], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists, takes 3 args])
|
||||
],[
|
||||
ZFS_LINUX_REQUIRE_API([i_op->set_acl()], [3.14])
|
||||
])
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.7 API change,
|
||||
dnl # The kernel get_acl will now check cache before calling i_op->get_acl and
|
||||
dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that
|
||||
dnl # anymore.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE], [
|
||||
ZFS_LINUX_TEST_SRC([get_acl_handle_cache], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
void *sentinel __attribute__ ((unused)) =
|
||||
uncached_acl_sentinel(NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [
|
||||
AC_MSG_CHECKING([whether uncached_acl_sentinel() exists])
|
||||
ZFS_LINUX_TEST_RESULT([get_acl_handle_cache], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1,
|
||||
[uncached_acl_sentinel() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t.
|
||||
dnl # It's an atomic_t on older kernels.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT], [
|
||||
ZFS_LINUX_TEST_SRC([acl_refcount], [
|
||||
#include <linux/backing-dev.h>
|
||||
#include <linux/refcount.h>
|
||||
#include <linux/posix_acl.h>
|
||||
],[
|
||||
struct posix_acl acl;
|
||||
refcount_t *r __attribute__ ((unused)) = &acl.a_refcount;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ACL_HAS_REFCOUNT], [
|
||||
AC_MSG_CHECKING([whether posix_acl has refcount_t])
|
||||
ZFS_LINUX_TEST_RESULT([acl_refcount], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_ACL_REFCOUNT, 1, [posix_acl has refcount_t])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE
|
||||
ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS
|
||||
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
|
||||
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
|
||||
ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE
|
||||
ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ACL], [
|
||||
ZFS_AC_KERNEL_POSIX_ACL_RELEASE
|
||||
ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE
|
||||
ZFS_AC_KERNEL_POSIX_ACL_CHMOD
|
||||
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
|
||||
ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
|
||||
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
|
||||
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
|
||||
ZFS_AC_KERNEL_ACL_HAS_REFCOUNT
|
||||
])
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
dnl #
|
||||
dnl # Linux 4.9-rc5+ ABI, removal of the .aio_fsync field
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_AIO_FSYNC], [
|
||||
ZFS_LINUX_TEST_SRC([aio_fsync], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.aio_fsync = NULL,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_AIO_FSYNC], [
|
||||
AC_MSG_CHECKING([whether fops->aio_fsync() exists])
|
||||
ZFS_LINUX_TEST_RESULT([aio_fsync], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_AIO_FSYNC, 1, [fops->aio_fsync() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,81 +0,0 @@
|
|||
dnl #
|
||||
dnl # Check available BDI interfaces.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BDI], [
|
||||
ZFS_LINUX_TEST_SRC([super_setup_bdi_name], [
|
||||
#include <linux/fs.h>
|
||||
struct super_block sb;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
atomic_long_t zfs_bdi_seq;
|
||||
int error __attribute__((unused));
|
||||
atomic_long_set(&zfs_bdi_seq, 0);
|
||||
error =
|
||||
super_setup_bdi_name(&sb, "%.28s-%ld", name,
|
||||
atomic_long_inc_return(&zfs_bdi_seq));
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bdi_setup_and_register], [
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bdi_setup_and_register_3args], [
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
unsigned int cap = BDI_CAP_MAP_COPY;
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name, cap);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
||||
dnl #
|
||||
dnl # 4.12, super_setup_bdi_name() introduced.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether super_setup_bdi_name() exists])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([super_setup_bdi_name],
|
||||
[super_setup_bdi_name], [fs/super.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1,
|
||||
[super_setup_bdi_name() exits])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 2 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([bdi_setup_and_register],
|
||||
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 2 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.34 - 3.19, bdi_setup_and_register()
|
||||
dnl # takes 3 arguments.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL(
|
||||
[bdi_setup_and_register_3args],
|
||||
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 3 args])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([bdi_setup])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -1,81 +1,3 @@
|
|||
dnl #
|
||||
dnl # 2.6.36 API change,
|
||||
dnl # REQ_FAILFAST_{DEV|TRANSPORT|DRIVER}
|
||||
dnl # REQ_DISCARD
|
||||
dnl # REQ_FLUSH
|
||||
dnl #
|
||||
dnl # 4.8 - 4.9 API,
|
||||
dnl # REQ_FLUSH was renamed to REQ_PREFLUSH
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_REQ], [
|
||||
ZFS_LINUX_TEST_SRC([req_failfast_mask], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_FAILFAST_MASK;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_discard], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_DISCARD;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_flush], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_FLUSH;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_preflush], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = REQ_PREFLUSH;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_FAILFAST_MASK], [
|
||||
AC_MSG_CHECKING([whether REQ_FAILFAST_MASK is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_failfast_mask], [
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([REQ_FAILFAST_MASK])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_DISCARD], [
|
||||
AC_MSG_CHECKING([whether REQ_DISCARD is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_discard], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_DISCARD, 1, [REQ_DISCARD is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_FLUSH], [
|
||||
AC_MSG_CHECKING([whether REQ_FLUSH is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_flush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_FLUSH, 1, [REQ_FLUSH is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_PREFLUSH], [
|
||||
AC_MSG_CHECKING([whether REQ_PREFLUSH is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_preflush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_PREFLUSH, 1, [REQ_PREFLUSH is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.8 API,
|
||||
dnl #
|
||||
|
@ -84,31 +6,6 @@ dnl # checking the bio->bi_rw flags. The following checks are used to
|
|||
dnl # detect if a specific operation is supported.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
||||
ZFS_LINUX_TEST_SRC([req_op_discard], [
|
||||
#include <linux/blk_types.h>
|
||||
],[
|
||||
int op __attribute__ ((unused)) = REQ_OP_DISCARD;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_op_secure_erase], [
|
||||
#include <linux/blk_types.h>
|
||||
],[
|
||||
int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([req_op_flush], [
|
||||
#include <linux/blk_types.h>
|
||||
],[
|
||||
int op __attribute__ ((unused)) = REQ_OP_FLUSH;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_bi_opf], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio bio __attribute__ ((unused));
|
||||
bio.bi_opf = 0;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bio_set_op_attrs], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
|
@ -117,47 +14,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_OPS], [
|
|||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD], [
|
||||
AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_op_discard], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_OP_DISCARD, 1, [REQ_OP_DISCARD is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE], [
|
||||
AC_MSG_CHECKING([whether REQ_OP_SECURE_ERASE is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_op_secure_erase], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
|
||||
[REQ_OP_SECURE_ERASE is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH], [
|
||||
AC_MSG_CHECKING([whether REQ_OP_FLUSH is defined])
|
||||
ZFS_LINUX_TEST_RESULT([req_op_flush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REQ_OP_FLUSH, 1, [REQ_OP_FLUSH is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
|
||||
AC_MSG_CHECKING([whether bio->bi_opf is defined])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bi_opf], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_OP_ATTRS], [
|
||||
AC_MSG_CHECKING([whether bio_set_op_attrs is available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [
|
||||
|
@ -210,127 +66,20 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO], [
|
|||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is available])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV, 1, [bio_set_dev() is available])
|
||||
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
||||
[bio_set_dev() GPL-only])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is a macro])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_macro], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_MACRO, 1,
|
||||
[bio_set_dev() is a macro])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
],[
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.3 API change
|
||||
dnl # Error argument dropped from bio_endio in favor of newly introduced
|
||||
dnl # bio->bi_error. This also replaces bio->bi_flags value BIO_UPTODATE.
|
||||
dnl # Introduced by torvalds/linux@4246a0b63bd8f56a1469b12eafeb875b1041a451
|
||||
dnl # ("block: add a bi_error field to struct bio").
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS], [
|
||||
ZFS_LINUX_TEST_SRC([bio_end_io_t_args], [
|
||||
#include <linux/bio.h>
|
||||
static void wanted_end_io(struct bio *bio) { return; }
|
||||
bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
|
||||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
|
||||
AC_MSG_CHECKING([whether bio_end_io_t wants 1 arg])
|
||||
ZFS_LINUX_TEST_RESULT([bio_end_io_t_args], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_1ARG_BIO_END_IO_T, 1,
|
||||
[bio_end_io_t wants 1 arg])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.13 API change
|
||||
dnl # The bio->bi_error field was replaced with bio->bi_status which is an
|
||||
dnl # enum which describes all possible error types.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BI_STATUS], [
|
||||
ZFS_LINUX_TEST_SRC([bio_bi_status], [
|
||||
#include <linux/bio.h>
|
||||
], [
|
||||
struct bio bio __attribute__ ((unused));
|
||||
blk_status_t status __attribute__ ((unused)) = BLK_STS_OK;
|
||||
bio.bi_status = status;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_STATUS], [
|
||||
AC_MSG_CHECKING([whether bio->bi_status exists])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bi_status], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BI_STATUS, 1, [bio->bi_status exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.14 API change,
|
||||
dnl # Immutable biovecs. A number of fields of struct bio are moved to
|
||||
dnl # struct bvec_iter.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER], [
|
||||
ZFS_LINUX_TEST_SRC([bio_bvec_iter], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio bio;
|
||||
bio.bi_iter.bi_sector = 0;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_BVEC_ITER], [
|
||||
AC_MSG_CHECKING([whether bio has bi_iter])
|
||||
ZFS_LINUX_TEST_RESULT([bio_bvec_iter], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BIO_BVEC_ITER, 1, [bio has bi_iter])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_GPL_ONLY, 1,
|
||||
[bio_set_dev() GPL-only])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.8 API change
|
||||
dnl # The rw argument has been removed from submit_bio/submit_bio_wait.
|
||||
dnl # Callers are now expected to set bio->bi_rw instead of passing it in.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO], [
|
||||
ZFS_LINUX_TEST_SRC([submit_bio], [
|
||||
#include <linux/bio.h>
|
||||
],[
|
||||
struct bio *bio = NULL;
|
||||
(void) submit_bio(bio);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SUBMIT_BIO], [
|
||||
AC_MSG_CHECKING([whether submit_bio() wants 1 arg])
|
||||
ZFS_LINUX_TEST_RESULT([submit_bio], [
|
||||
AC_MSG_CHECKING([whether bio_set_dev() is a macro])
|
||||
ZFS_LINUX_TEST_RESULT([bio_set_dev_macro], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_1ARG_SUBMIT_BIO, 1, [submit_bio() wants 1 arg])
|
||||
AC_DEFINE(HAVE_BIO_SET_DEV_MACRO, 1,
|
||||
[bio_set_dev() is a macro])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
@ -449,31 +198,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_SUBMIT_BIO_RETURNS_VOID], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 5.16 API
|
||||
dnl #
|
||||
dnl # The Linux 5.16 API moved struct blkcg_gq into linux/blk-cgroup.h, which
|
||||
dnl # has been around since 2015. This test looks for the presence of that
|
||||
dnl # header, so that it can be conditionally included where it exists, but
|
||||
dnl # still be backward compatible with kernels that pre-date its introduction.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_CGROUP_HEADER], [
|
||||
ZFS_LINUX_TEST_SRC([blk_cgroup_header], [
|
||||
#include <linux/blk-cgroup.h>
|
||||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_CGROUP_HEADER], [
|
||||
AC_MSG_CHECKING([whether linux/blk-cgroup.h exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_cgroup_header],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LINUX_BLK_CGROUP_HEADER, 1,
|
||||
[linux/blk-cgroup.h exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 5.18 API
|
||||
dnl #
|
||||
|
@ -510,43 +234,22 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_ALLOC_4ARG], [
|
|||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO], [
|
||||
ZFS_AC_KERNEL_SRC_REQ
|
||||
ZFS_AC_KERNEL_SRC_BIO_OPS
|
||||
ZFS_AC_KERNEL_SRC_BIO_SET_DEV
|
||||
ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS
|
||||
ZFS_AC_KERNEL_SRC_BIO_BI_STATUS
|
||||
ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER
|
||||
ZFS_AC_KERNEL_SRC_BIO_SUBMIT_BIO
|
||||
ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST
|
||||
ZFS_AC_KERNEL_SRC_BLKG_TRYGET
|
||||
ZFS_AC_KERNEL_SRC_BIO_BDEV_DISK
|
||||
ZFS_AC_KERNEL_SRC_BDEV_SUBMIT_BIO_RETURNS_VOID
|
||||
ZFS_AC_KERNEL_SRC_BIO_SET_DEV_MACRO
|
||||
ZFS_AC_KERNEL_SRC_BLK_CGROUP_HEADER
|
||||
ZFS_AC_KERNEL_SRC_BIO_ALLOC_4ARG
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BIO], [
|
||||
ZFS_AC_KERNEL_BIO_REQ_FAILFAST_MASK
|
||||
ZFS_AC_KERNEL_BIO_REQ_DISCARD
|
||||
ZFS_AC_KERNEL_BIO_REQ_FLUSH
|
||||
ZFS_AC_KERNEL_BIO_REQ_PREFLUSH
|
||||
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_DISCARD
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_BIO_REQ_OP_FLUSH
|
||||
ZFS_AC_KERNEL_BIO_BI_OPF
|
||||
ZFS_AC_KERNEL_BIO_SET_OP_ATTRS
|
||||
|
||||
ZFS_AC_KERNEL_BIO_SET_DEV
|
||||
ZFS_AC_KERNEL_BIO_END_IO_T_ARGS
|
||||
ZFS_AC_KERNEL_BIO_BI_STATUS
|
||||
ZFS_AC_KERNEL_BIO_BVEC_ITER
|
||||
ZFS_AC_KERNEL_BIO_SUBMIT_BIO
|
||||
ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST
|
||||
ZFS_AC_KERNEL_BLKG_TRYGET
|
||||
ZFS_AC_KERNEL_BIO_BDEV_DISK
|
||||
ZFS_AC_KERNEL_BDEV_SUBMIT_BIO_RETURNS_VOID
|
||||
ZFS_AC_KERNEL_BLK_CGROUP_HEADER
|
||||
ZFS_AC_KERNEL_BIO_ALLOC_4ARG
|
||||
])
|
||||
|
|
|
@ -161,7 +161,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [
|
|||
dnl #
|
||||
dnl # 5.19: bdev_max_secure_erase_sectors() available
|
||||
dnl # 4.8: blk_queue_secure_erase() available
|
||||
dnl # 2.6.36: blk_queue_secdiscard() available
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [
|
||||
ZFS_LINUX_TEST_SRC([bdev_max_secure_erase_sectors], [
|
||||
|
@ -182,16 +181,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [
|
|||
memset(q, 0, sizeof(r));
|
||||
value = blk_queue_secure_erase(q);
|
||||
],[-Wframe-larger-than=8192])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct request_queue r;
|
||||
struct request_queue *q = &r;
|
||||
int value __attribute__ ((unused));
|
||||
memset(q, 0, sizeof(r));
|
||||
value = blk_queue_secdiscard(q);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
||||
|
@ -209,137 +198,11 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [
|
|||
AC_DEFINE(HAVE_BLK_QUEUE_SECURE_ERASE, 1,
|
||||
[blk_queue_secure_erase() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether blk_queue_secdiscard() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_secdiscard], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_SECDISCARD, 1,
|
||||
[blk_queue_secdiscard() is available])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([blk_queue_secure_erase])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([blk_queue_secure_erase])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.16 API change,
|
||||
dnl # Introduction of blk_queue_flag_set and blk_queue_flag_clear
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_flag_set], [
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct request_queue *q = NULL;
|
||||
blk_queue_flag_set(0, q);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET], [
|
||||
AC_MSG_CHECKING([whether blk_queue_flag_set() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flag_set], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_SET, 1,
|
||||
[blk_queue_flag_set() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_flag_clear], [
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/blkdev.h>
|
||||
],[
|
||||
struct request_queue *q = NULL;
|
||||
blk_queue_flag_clear(0, q);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR], [
|
||||
AC_MSG_CHECKING([whether blk_queue_flag_clear() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flag_clear], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLAG_CLEAR, 1,
|
||||
[blk_queue_flag_clear() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.36 API change,
|
||||
dnl # Added blk_queue_flush() interface, while the previous interface
|
||||
dnl # was available to all the new one is GPL-only. Thus in addition to
|
||||
dnl # detecting if this function is available we determine if it is
|
||||
dnl # GPL-only. If the GPL-only interface is there we implement our own
|
||||
dnl # compatibility function, otherwise we use the function. The hope
|
||||
dnl # is that long term this function will be opened up.
|
||||
dnl #
|
||||
dnl # 4.7 API change,
|
||||
dnl # Replace blk_queue_flush with blk_queue_write_cache
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_flush], [
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||
(void) blk_queue_flush(q, REQ_FLUSH);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
struct request_queue *q __attribute__ ((unused)) = NULL;
|
||||
blk_queue_write_cache(q, true, true);
|
||||
], [], [ZFS_META_LICENSE])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
||||
AC_MSG_CHECKING([whether blk_queue_flush() is available])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flush], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH, 1,
|
||||
[blk_queue_flush() is available])
|
||||
|
||||
AC_MSG_CHECKING([whether blk_queue_flush() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_flush_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY, 1,
|
||||
[blk_queue_flush() is GPL-only])
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.7 API change
|
||||
dnl # Replace blk_queue_flush with blk_queue_write_cache
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether blk_queue_write_cache() exists])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_write_cache], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE, 1,
|
||||
[blk_queue_write_cache() exists])
|
||||
|
||||
AC_MSG_CHECKING([whether blk_queue_write_cache() is GPL-only])
|
||||
ZFS_LINUX_TEST_RESULT([blk_queue_write_cache_license], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY, 1,
|
||||
[blk_queue_write_cache() is GPL-only])
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.34 API change
|
||||
dnl # blk_queue_max_hw_sectors() replaces blk_queue_max_sectors().
|
||||
|
@ -385,24 +248,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # See if kernel supports block multi-queue and blk_status_t.
|
||||
dnl # blk_status_t represents the new status codes introduced in the 4.13
|
||||
dnl # kernel patch:
|
||||
dnl #
|
||||
dnl # block: introduce new block status code type
|
||||
dnl #
|
||||
dnl # We do not currently support the "old" block multi-queue interfaces from
|
||||
dnl # prior kernels.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ], [
|
||||
ZFS_LINUX_TEST_SRC([blk_mq], [
|
||||
#include <linux/blk-mq.h>
|
||||
], [
|
||||
struct blk_mq_tag_set tag_set __attribute__ ((unused)) = {0};
|
||||
(void) blk_mq_alloc_tag_set(&tag_set);
|
||||
return BLK_STS_OK;
|
||||
], [])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ_RQ_HCTX], [
|
||||
ZFS_LINUX_TEST_SRC([blk_mq_rq_hctx], [
|
||||
#include <linux/blk-mq.h>
|
||||
#include <linux/blkdev.h>
|
||||
|
@ -413,18 +259,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_MQ], [
|
|||
], [])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ], [
|
||||
AC_MSG_CHECKING([whether block multiqueue with blk_status_t is available])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_MQ_RQ_HCTX], [
|
||||
AC_MSG_CHECKING([whether block multiqueue hardware context is cached in struct request])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq_rq_hctx], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_MQ, 1, [block multiqueue is available])
|
||||
AC_MSG_CHECKING([whether block multiqueue hardware context is cached in struct request])
|
||||
ZFS_LINUX_TEST_RESULT([blk_mq_rq_hctx], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BLK_MQ_RQ_HCTX, 1, [block multiqueue hardware context is cached in struct request])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_DEFINE(HAVE_BLK_MQ_RQ_HCTX, 1, [block multiqueue hardware context is cached in struct request])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
@ -437,12 +276,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE], [
|
|||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_UPDATE_READAHEAD
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_HW_SECTORS
|
||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_SEGMENTS
|
||||
ZFS_AC_KERNEL_SRC_BLK_MQ
|
||||
ZFS_AC_KERNEL_SRC_BLK_MQ_RQ_HCTX
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE], [
|
||||
|
@ -452,10 +288,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE], [
|
|||
ZFS_AC_KERNEL_BLK_QUEUE_UPDATE_READAHEAD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_DISCARD
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_FLUSH
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS
|
||||
ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS
|
||||
ZFS_AC_KERNEL_BLK_MQ
|
||||
ZFS_AC_KERNEL_BLK_MQ_RQ_HCTX
|
||||
])
|
||||
|
|
|
@ -396,7 +396,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV], [
|
|||
dnl #
|
||||
dnl # 5.11 API, lookup_bdev() takes dev_t argument.
|
||||
dnl # 2.6.27 API, lookup_bdev() was first exported.
|
||||
dnl # 4.4.0-6.21 API, lookup_bdev() on Ubuntu takes mode argument.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
||||
ZFS_LINUX_TEST_SRC([lookup_bdev_devt], [
|
||||
|
@ -418,15 +417,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
|||
|
||||
bdev = lookup_bdev(path);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([lookup_bdev_mode], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct block_device *bdev __attribute__ ((unused));
|
||||
const char path[] = "/example/path";
|
||||
|
||||
bdev = lookup_bdev(path, FMODE_READ);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
||||
|
@ -446,17 +436,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
|||
AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
|
||||
[lookup_bdev() wants 1 arg])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether lookup_bdev() wants mode arg])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_mode],
|
||||
[lookup_bdev], [fs/block_dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MODE_LOOKUP_BDEV, 1,
|
||||
[lookup_bdev() wants mode arg])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.5.0 API change
|
||||
dnl # torvalds/linux@dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430 and
|
||||
dnl # torvalds/linux@7994e6f7254354e03028a11f98a27bd67dace9f1 reworked
|
||||
dnl # where inode_sync_wait() is called.
|
||||
dnl #
|
||||
dnl # Prior to these changes it would occur in end_writeback() but due
|
||||
dnl # to various issues (described in the above commits) it has been
|
||||
dnl # moved to evict(). This changes the ordering is which sync occurs
|
||||
dnl # but otherwise doesn't impact the zpl implementation.
|
||||
dnl #
|
||||
dnl # The major impact here is the renaming of end_writeback() to
|
||||
dnl # clear_inode(). However, care must be taken when detecting this
|
||||
dnl # API change because as recently as 2.6.35 there was a clear_inode()
|
||||
dnl # function. However, it was made obsolete by the evict_inode() API
|
||||
dnl # change at the same time.
|
||||
dnl #
|
||||
dnl # Therefore, to ensure we have the correct API we only allow the
|
||||
dnl # clear_inode() compatibility code to be defined iff the evict_inode()
|
||||
dnl # functionality is also detected.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CLEAR_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([clear_inode], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
clear_inode(NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CLEAR_INODE], [
|
||||
AC_MSG_CHECKING([whether clear_inode() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([clear_inode],
|
||||
[clear_inode], [fs/inode.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CLEAR_INODE, 1, [clear_inode() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -4,21 +4,6 @@ dnl # detected at configure time and cause a build failure. Otherwise
|
|||
dnl # modules may be successfully built that behave incorrectly.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEFINED], [
|
||||
AS_IF([test "x$cross_compiling" != xyes], [
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include "$LINUX/include/linux/license.h"
|
||||
], [
|
||||
return !license_is_gpl_compatible(
|
||||
"$ZFS_META_LICENSE");
|
||||
])
|
||||
], [
|
||||
AC_DEFINE([ZFS_IS_GPL_COMPATIBLE], [1],
|
||||
[Define to 1 if GPL-only symbols can be used])
|
||||
], [
|
||||
])
|
||||
])
|
||||
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_MODULES
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_BLOCK
|
||||
ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.9, current_time() added
|
||||
dnl # 4.18, return type changed from timespec to timespec64
|
||||
dnl #
|
||||
dnl # Note that we don't care about the return type in this check. If we have
|
||||
dnl # to implement a fallback, we'll know we're <4.9, which was timespec.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CURRENT_TIME], [
|
||||
ZFS_LINUX_TEST_SRC([current_time], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct inode ip __attribute__ ((unused));
|
||||
(void) current_time(&ip);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CURRENT_TIME], [
|
||||
AC_MSG_CHECKING([whether current_time() exists])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([current_time],
|
||||
[current_time], [fs/inode.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CURRENT_TIME, 1, [current_time() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,30 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.18 API change
|
||||
dnl # Dentry aliases are in d_u struct dentry member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY_ALIAS_D_U], [
|
||||
ZFS_LINUX_TEST_SRC([dentry_alias_d_u], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/list.h>
|
||||
], [
|
||||
struct inode *inode __attribute__ ((unused)) = NULL;
|
||||
struct dentry *dentry __attribute__ ((unused)) = NULL;
|
||||
hlist_for_each_entry(dentry, &inode->i_dentry,
|
||||
d_u.d_alias) {
|
||||
d_drop(dentry);
|
||||
}
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY_ALIAS_D_U], [
|
||||
AC_MSG_CHECKING([whether dentry aliases are in d_u member])
|
||||
ZFS_LINUX_TEST_RESULT([dentry_alias_d_u], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DENTRY_D_U_ALIASES, 1,
|
||||
[dentry aliases are in d_u member])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
|
@ -1,26 +1,3 @@
|
|||
dnl #
|
||||
dnl # 3.4.0 API change
|
||||
dnl # Added d_make_root() to replace previous d_alloc_root() function.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_MAKE_ROOT], [
|
||||
ZFS_LINUX_TEST_SRC([d_make_root], [
|
||||
#include <linux/dcache.h>
|
||||
], [
|
||||
d_make_root(NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_MAKE_ROOT], [
|
||||
AC_MSG_CHECKING([whether d_make_root() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([d_make_root],
|
||||
[d_make_root], [fs/dcache.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_MAKE_ROOT, 1, [d_make_root() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.28 API change
|
||||
dnl # Added d_obtain_alias() helper function.
|
||||
|
@ -43,31 +20,6 @@ AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.12 API change
|
||||
dnl # d_prune_aliases() helper function available.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES], [
|
||||
ZFS_LINUX_TEST_SRC([d_prune_aliases], [
|
||||
#include <linux/dcache.h>
|
||||
], [
|
||||
struct inode *ip = NULL;
|
||||
d_prune_aliases(ip);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], [
|
||||
AC_MSG_CHECKING([whether d_prune_aliases() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([d_prune_aliases],
|
||||
[d_prune_aliases], [fs/dcache.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1,
|
||||
[d_prune_aliases() is available])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([d_prune_aliases()])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.38 API change
|
||||
dnl # Added d_set_d_op() helper function.
|
||||
|
@ -90,101 +42,14 @@ AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.6 API change
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA], [
|
||||
ZFS_LINUX_TEST_SRC([dentry_operations_revalidate], [
|
||||
#include <linux/dcache.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
static int revalidate (struct dentry *dentry,
|
||||
struct nameidata *nidata) { return 0; }
|
||||
|
||||
static const struct dentry_operations
|
||||
dops __attribute__ ((unused)) = {
|
||||
.d_revalidate = revalidate,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
|
||||
AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
|
||||
ZFS_LINUX_TEST_RESULT([dentry_operations_revalidate], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
|
||||
[dops->d_revalidate() operation takes nameidata])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.30 API change
|
||||
dnl # The 'struct dentry_operations' was constified in the dentry structure.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS], [
|
||||
ZFS_LINUX_TEST_SRC([dentry_operations_const], [
|
||||
#include <linux/dcache.h>
|
||||
|
||||
const struct dentry_operations test_d_op = {
|
||||
.d_revalidate = NULL,
|
||||
};
|
||||
],[
|
||||
struct dentry d __attribute__ ((unused));
|
||||
d.d_op = &test_d_op;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [
|
||||
AC_MSG_CHECKING([whether dentry uses const struct dentry_operations])
|
||||
ZFS_LINUX_TEST_RESULT([dentry_operations_const], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1,
|
||||
[dentry uses const struct dentry_operations])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([const dentry_operations])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.38 API change
|
||||
dnl # Added sb->s_d_op default dentry_operations member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_S_D_OP], [
|
||||
ZFS_LINUX_TEST_SRC([super_block_s_d_op], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct super_block sb __attribute__ ((unused));
|
||||
sb.s_d_op = NULL;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_S_D_OP], [
|
||||
AC_MSG_CHECKING([whether super_block has s_d_op])
|
||||
ZFS_LINUX_TEST_RESULT([super_block_s_d_op], [
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([super_block s_d_op])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
||||
ZFS_AC_KERNEL_SRC_D_MAKE_ROOT
|
||||
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_SRC_D_PRUNE_ALIASES
|
||||
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_SRC_D_REVALIDATE_NAMEIDATA
|
||||
ZFS_AC_KERNEL_SRC_CONST_DENTRY_OPERATIONS
|
||||
ZFS_AC_KERNEL_SRC_S_D_OP
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
||||
ZFS_AC_KERNEL_D_MAKE_ROOT
|
||||
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_D_PRUNE_ALIASES
|
||||
ZFS_AC_KERNEL_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA
|
||||
ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS
|
||||
ZFS_AC_KERNEL_S_D_OP
|
||||
])
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.0 API change
|
||||
dnl # The sops->dirty_inode() callbacks were updated to take a flags
|
||||
dnl # argument. This allows the greater control over whether the
|
||||
dnl # filesystem needs to push out a transaction or not.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DIRTY_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([dirty_inode_with_flags], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static void dirty_inode(struct inode *a, int b) { return; }
|
||||
|
||||
static const struct super_operations
|
||||
sops __attribute__ ((unused)) = {
|
||||
.dirty_inode = dirty_inode,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE], [
|
||||
AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
|
||||
ZFS_LINUX_TEST_RESULT([dirty_inode_with_flags], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
|
||||
[sops->dirty_inode() wants flags])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
|
@ -1,27 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.5.0 API change
|
||||
dnl # torvalds/linux@b0b0382bb4904965a9e9fca77ad87514dfda0d1c changed the
|
||||
dnl # ->encode_fh() callback to pass the child inode and its parents inode
|
||||
dnl # rather than a dentry and a boolean saying whether we want the parent.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([export_operations_encode_fh], [
|
||||
#include <linux/exportfs.h>
|
||||
static int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
|
||||
struct inode *parent) { return 0; }
|
||||
static struct export_operations eops __attribute__ ((unused))={
|
||||
.encode_fh = encode_fh,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE], [
|
||||
AC_MSG_CHECKING([whether eops->encode_fh() wants inode])
|
||||
ZFS_LINUX_TEST_RESULT([export_operations_encode_fh], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_ENCODE_FH_WITH_INODE, 1,
|
||||
[eops->encode_fh() wants child and parent inodes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,24 +0,0 @@
|
|||
dnl #
|
||||
dnl # 2.6.36 API change
|
||||
dnl # The sops->delete_inode() and sops->clear_inode() callbacks have
|
||||
dnl # replaced by a single sops->evict_inode() callback.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_EVICT_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([evict_inode], [
|
||||
#include <linux/fs.h>
|
||||
static void evict_inode (struct inode * t) { return; }
|
||||
static struct super_operations sops __attribute__ ((unused)) = {
|
||||
.evict_inode = evict_inode,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [
|
||||
AC_MSG_CHECKING([whether sops->evict_inode() exists])
|
||||
ZFS_LINUX_TEST_RESULT([evict_inode], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([evict_inode])
|
||||
])
|
||||
])
|
|
@ -1,23 +0,0 @@
|
|||
dnl #
|
||||
dnl # Linux 4.19 API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FADVISE], [
|
||||
ZFS_LINUX_TEST_SRC([file_fadvise], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fadvise = NULL,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FADVISE], [
|
||||
AC_MSG_CHECKING([whether fops->fadvise() exists])
|
||||
ZFS_LINUX_TEST_RESULT([file_fadvise], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_FADVISE, 1, [fops->fadvise() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,44 +0,0 @@
|
|||
dnl #
|
||||
dnl # Linux 2.6.38 - 3.x API
|
||||
dnl # The fallocate callback was moved from the inode_operations
|
||||
dnl # structure to the file_operations structure.
|
||||
dnl #
|
||||
dnl #
|
||||
dnl # Linux 3.15+
|
||||
dnl # fallocate learned a new flag, FALLOC_FL_ZERO_RANGE
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [
|
||||
ZFS_LINUX_TEST_SRC([file_fallocate], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static long test_fallocate(struct file *file, int mode,
|
||||
loff_t offset, loff_t len) { return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fallocate = test_fallocate,
|
||||
};
|
||||
], [])
|
||||
ZFS_LINUX_TEST_SRC([falloc_fl_zero_range], [
|
||||
#include <linux/falloc.h>
|
||||
],[
|
||||
int flags __attribute__ ((unused));
|
||||
flags = FALLOC_FL_ZERO_RANGE;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
|
||||
AC_MSG_CHECKING([whether fops->fallocate() exists])
|
||||
ZFS_LINUX_TEST_RESULT([file_fallocate], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING([whether FALLOC_FL_ZERO_RANGE exists])
|
||||
ZFS_LINUX_TEST_RESULT([falloc_fl_zero_range], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FALLOC_FL_ZERO_RANGE, 1, [FALLOC_FL_ZERO_RANGE is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([file_fallocate])
|
||||
])
|
||||
])
|
|
@ -1,24 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.1 API change
|
||||
dnl # struct access file->f_path.dentry was replaced by accessor function
|
||||
dnl # since fix torvalds/linux@4bacc9c9234c ("overlayfs: Make f_path always
|
||||
dnl # point to the overlay and f_inode to the underlay").
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_DENTRY], [
|
||||
ZFS_LINUX_TEST_SRC([file_dentry], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct file *f = NULL;
|
||||
file_dentry(f);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_DENTRY], [
|
||||
AC_MSG_CHECKING([whether file_dentry() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_DENTRY, 1, [file_dentry() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,23 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.19 API change
|
||||
dnl # struct access f->f_dentry->d_inode was replaced by accessor function
|
||||
dnl # file_inode(f)
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILE_INODE], [
|
||||
ZFS_LINUX_TEST_SRC([file_inode], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct file *f = NULL;
|
||||
file_inode(f);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILE_INODE], [
|
||||
AC_MSG_CHECKING([whether file_inode() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_inode], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILE_INODE, 1, [file_inode() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,27 +0,0 @@
|
|||
dnl #
|
||||
dnl # filemap_range_has_page was not available till 4.13
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FILEMAP], [
|
||||
ZFS_LINUX_TEST_SRC([filemap_range_has_page], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/pagemap.h>
|
||||
],[
|
||||
struct address_space *mapping = NULL;
|
||||
loff_t lstart = 0;
|
||||
loff_t lend = 0;
|
||||
bool ret __attribute__ ((unused));
|
||||
|
||||
ret = filemap_range_has_page(mapping, lstart, lend);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FILEMAP], [
|
||||
AC_MSG_CHECKING([whether filemap_range_has_page() is available])
|
||||
ZFS_LINUX_TEST_RESULT([filemap_range_has_page], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FILEMAP_RANGE_HAS_PAGE, 1,
|
||||
[filemap_range_has_page() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,53 +0,0 @@
|
|||
dnl #
|
||||
dnl # Check file_operations->fsync interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [
|
||||
ZFS_LINUX_TEST_SRC([fsync_without_dentry], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_fsync(struct file *f, int x) { return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fsync = test_fsync,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([fsync_range], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_fsync(struct file *f, loff_t a, loff_t b, int c)
|
||||
{ return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.fsync = test_fsync,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
|
||||
dnl #
|
||||
dnl # Linux 2.6.35 - Linux 3.0 API
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->fsync() wants no dentry])
|
||||
ZFS_LINUX_TEST_RESULT([fsync_without_dentry], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
|
||||
[fops->fsync() without dentry])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 3.1 - 3.x API
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->fsync() wants range])
|
||||
ZFS_LINUX_TEST_RESULT([fsync_range], [
|
||||
AC_MSG_RESULT([range])
|
||||
AC_DEFINE(HAVE_FSYNC_RANGE, 1,
|
||||
[fops->fsync() with range])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([fops->fsync])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -48,12 +48,16 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_FILLATTR], [
|
|||
AC_DEFINE(HAVE_GENERIC_FILLATTR_IDMAP_REQMASK, 1,
|
||||
[generic_fillattr requires struct mnt_idmap* and u32 request_mask])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
AC_MSG_CHECKING([whether generic_fillattr requires struct mnt_idmap*])
|
||||
ZFS_LINUX_TEST_RESULT([generic_fillattr_mnt_idmap], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GENERIC_FILLATTR_IDMAP, 1,
|
||||
[generic_fillattr requires struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
AC_MSG_CHECKING([whether generic_fillattr requires struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT([generic_fillattr_userns], [
|
||||
AC_MSG_RESULT([yes])
|
||||
|
|
|
@ -49,18 +49,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
|||
bio_end_io_acct(bio, start_time);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
||||
#include <linux/bio.h>
|
||||
|
||||
void (*generic_start_io_acct_f)(int, unsigned long,
|
||||
struct hd_struct *) = &generic_start_io_acct;
|
||||
void (*generic_end_io_acct_f)(int, struct hd_struct *,
|
||||
unsigned long) = &generic_end_io_acct;
|
||||
], [
|
||||
generic_start_io_acct(0, 0, NULL);
|
||||
generic_end_io_acct(0, NULL, 0);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([generic_acct_4args], [
|
||||
#include <linux/bio.h>
|
||||
|
||||
|
@ -138,23 +126,6 @@ AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
|||
[generic_*_io_acct() 4 arg available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 3.19 API addition
|
||||
dnl #
|
||||
dnl # torvalds/linux@394ffa50 allows us to increment
|
||||
dnl # iostat counters without generic_make_request().
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether generic_*_io_acct wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||
[generic_start_io_acct], [block/bio.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||
[generic_*_io_acct() 3 arg available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.10 API
|
||||
dnl #
|
||||
dnl # NULL inode_operations.readlink implies generic_readlink(), which
|
||||
dnl # has been made static.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL], [
|
||||
ZFS_LINUX_TEST_SRC([generic_readlink_global], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
int i __attribute__ ((unused));
|
||||
i = generic_readlink(NULL, NULL, 0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL], [
|
||||
AC_MSG_CHECKING([whether generic_readlink is global])
|
||||
ZFS_LINUX_TEST_RESULT([generic_readlink_global], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_GENERIC_READLINK, 1,
|
||||
[generic_readlink is global])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
|
@ -17,12 +17,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENHD_FLAGS], [
|
|||
], [
|
||||
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([genhd_fl_no_part_scan], [
|
||||
#include <linux/blkdev.h>
|
||||
], [
|
||||
int flags __attribute__ ((unused)) = GENHD_FL_NO_PART_SCAN;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GENHD_FLAGS], [
|
||||
|
@ -30,29 +24,18 @@ AC_DEFUN([ZFS_AC_KERNEL_GENHD_FLAGS], [
|
|||
AC_MSG_CHECKING([whether GENHD_FL_EXT_DEVT flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([genhd_fl_ext_devt], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, GENHD_FL_EXT_DEVT,
|
||||
AC_DEFINE(HAVE_GENHD_FL_EXT_DEVT, 1,
|
||||
[GENHD_FL_EXT_DEVT flag is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(ZFS_GENHD_FL_EXT_DEVT, 0,
|
||||
[GENHD_FL_EXT_DEVT flag is not available])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether GENHD_FL_NO_PART flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART,
|
||||
AC_DEFINE(HAVE_GENHD_FL_NO_PART, 1,
|
||||
[GENHD_FL_NO_PART flag is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether GENHD_FL_NO_PART_SCAN flag is available])
|
||||
ZFS_LINUX_TEST_RESULT([genhd_fl_no_part_scan], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GENHD_FL_NO_PART, GENHD_FL_NO_PART_SCAN,
|
||||
[GENHD_FL_NO_PART_SCAN flag is available])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([GENHD_FL_NO_PART|GENHD_FL_NO_PART_SCAN])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
dnl #
|
||||
dnl # Supported get_link() interfaces checked newest to oldest.
|
||||
dnl # Note this interface used to be named follow_link.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_LINK], [
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_get_link], [
|
||||
#include <linux/fs.h>
|
||||
static const char *get_link(struct dentry *de, struct inode *ip,
|
||||
struct delayed_call *done) { return "symlink"; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.get_link = get_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_get_link_cookie], [
|
||||
#include <linux/fs.h>
|
||||
static const char *get_link(struct dentry *de, struct
|
||||
inode *ip, void **cookie) { return "symlink"; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.get_link = get_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_follow_link], [
|
||||
#include <linux/fs.h>
|
||||
static const char *follow_link(struct dentry *de,
|
||||
void **cookie) { return "symlink"; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.follow_link = follow_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_follow_link_nameidata], [
|
||||
#include <linux/fs.h>
|
||||
static void *follow_link(struct dentry *de, struct
|
||||
nameidata *nd) { return (void *)NULL; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.follow_link = follow_link,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GET_LINK], [
|
||||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # The get_link interface has added a delayed done call and
|
||||
dnl # used it to retire the put_link() interface.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->get_link() passes delayed])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GET_LINK_DELAYED, 1, [iops->get_link() delayed])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # The follow_link() interface has been replaced by
|
||||
dnl # get_link() which behaves the same as before except:
|
||||
dnl # - An inode is passed as a separate argument
|
||||
dnl # - When called in RCU mode a NULL dentry is passed.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->get_link() passes cookie])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_get_link_cookie], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GET_LINK_COOKIE, 1,
|
||||
[iops->get_link() cookie])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 4.2 API change
|
||||
dnl # This kernel retired the nameidata structure.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether iops->follow_link() passes cookie])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_follow_link], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FOLLOW_LINK_COOKIE, 1,
|
||||
[iops->follow_link() cookie])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.32 API
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether iops->follow_link() passes nameidata])
|
||||
ZFS_LINUX_TEST_RESULT(
|
||||
[inode_operations_follow_link_nameidata],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
|
||||
[iops->follow_link() nameidata])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([get_link])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -1,128 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.8 API change
|
||||
dnl #
|
||||
dnl # 75ef71840539 mm, vmstat: add infrastructure for per-node vmstats
|
||||
dnl # 599d0c954f91 mm, vmscan: move LRU lists to node
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE], [
|
||||
ZFS_LINUX_TEST_SRC([global_node_page_state], [
|
||||
#include <linux/mm.h>
|
||||
#include <linux/vmstat.h>
|
||||
],[
|
||||
(void) global_node_page_state(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE], [
|
||||
AC_MSG_CHECKING([whether global_node_page_state() exists])
|
||||
ZFS_LINUX_TEST_RESULT([global_node_page_state], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GLOBAL_NODE_PAGE_STATE, 1,
|
||||
[global_node_page_state() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.14 API change
|
||||
dnl #
|
||||
dnl # c41f012ade0b mm: rename global_page_state to global_zone_page_state
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE], [
|
||||
ZFS_LINUX_TEST_SRC([global_zone_page_state], [
|
||||
#include <linux/mm.h>
|
||||
#include <linux/vmstat.h>
|
||||
],[
|
||||
(void) global_zone_page_state(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE], [
|
||||
AC_MSG_CHECKING([whether global_zone_page_state() exists])
|
||||
ZFS_LINUX_TEST_RESULT([global_zone_page_state], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZFS_GLOBAL_ZONE_PAGE_STATE, 1,
|
||||
[global_zone_page_state() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Create a define and autoconf variable for an enum member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_ENUM_MEMBER], [
|
||||
AC_MSG_CHECKING([whether enum $2 contains $1])
|
||||
AS_IF([AC_TRY_COMMAND(
|
||||
"${srcdir}/scripts/enum-extract.pl" "$2" "$3" | grep -Eqx $1)],[
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(m4_join([_], [ZFS_ENUM], m4_toupper($2), $1), 1,
|
||||
[enum $2 contains $1])
|
||||
m4_join([_], [ZFS_ENUM], m4_toupper($2), $1)=1
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Sanity check helpers
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_RESULT([$1 in either node_stat_item or zone_stat_item: $2])
|
||||
ZFS_LINUX_TEST_ERROR([global page state])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK], [
|
||||
enum_check_a="m4_join([_], [$ZFS_ENUM_NODE_STAT_ITEM], $1)"
|
||||
enum_check_b="m4_join([_], [$ZFS_ENUM_ZONE_STAT_ITEM], $1)"
|
||||
AS_IF([test -n "$enum_check_a" -a -n "$enum_check_b"],[
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [DUPLICATE])
|
||||
])
|
||||
AS_IF([test -z "$enum_check_a" -a -z "$enum_check_b"],[
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_ERROR([$1], [NOT FOUND])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Ensure the config tests are finding one and only one of each enum.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
|
||||
AC_MSG_CHECKING([whether global_page_state enums are sane])
|
||||
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_FILE])
|
||||
|
||||
AC_MSG_RESULT(yes)
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE], [
|
||||
ZFS_AC_KERNEL_SRC_GLOBAL_NODE_PAGE_STATE
|
||||
ZFS_AC_KERNEL_SRC_GLOBAL_ZONE_PAGE_STATE
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # enum members in which we're interested
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
|
||||
ZFS_AC_KERNEL_GLOBAL_NODE_PAGE_STATE
|
||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE
|
||||
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
|
||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_ANON],
|
||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||
|
||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
|
||||
])
|
|
@ -1,22 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.9 API change
|
||||
dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GROUP_INFO_GID], [
|
||||
ZFS_LINUX_TEST_SRC([group_info_gid], [
|
||||
#include <linux/cred.h>
|
||||
],[
|
||||
struct group_info gi __attribute__ ((unused)) = {};
|
||||
gi.gid[0] = KGIDT_INIT(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
|
||||
AC_MSG_CHECKING([whether group_info->gid exists])
|
||||
ZFS_LINUX_TEST_RESULT([group_info_gid], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,26 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.6 API change
|
||||
dnl # Added CPU hotplug APIs
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_CPU_HOTPLUG], [
|
||||
ZFS_LINUX_TEST_SRC([cpu_hotplug], [
|
||||
#include <linux/cpuhotplug.h>
|
||||
],[
|
||||
enum cpuhp_state state = CPUHP_ONLINE;
|
||||
int (*fp)(unsigned int, struct hlist_node *) = NULL;
|
||||
cpuhp_state_add_instance_nocalls(0, (struct hlist_node *)NULL);
|
||||
cpuhp_state_remove_instance_nocalls(0, (struct hlist_node *)NULL);
|
||||
cpuhp_setup_state_multi(state, "", fp, fp);
|
||||
cpuhp_remove_multi_state(0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_CPU_HOTPLUG], [
|
||||
AC_MSG_CHECKING([whether CPU hotplug APIs exist])
|
||||
ZFS_LINUX_TEST_RESULT([cpu_hotplug], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_CPU_HOTPLUG, 1, [yes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,24 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # Added in_compat_syscall() which can be overridden on a per-
|
||||
dnl # architecture basis. Prior to this is_compat_task() was the
|
||||
dnl # provided interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL], [
|
||||
ZFS_LINUX_TEST_SRC([in_compat_syscall], [
|
||||
#include <linux/compat.h>
|
||||
],[
|
||||
in_compat_syscall();
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_IN_COMPAT_SYSCALL], [
|
||||
AC_MSG_CHECKING([whether in_compat_syscall() is available])
|
||||
ZFS_LINUX_TEST_RESULT([in_compat_syscall], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IN_COMPAT_SYSCALL, 1,
|
||||
[in_compat_syscall() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -57,20 +57,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_GETATTR], [
|
|||
.getattr = test_getattr,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_getattr_vfsmount], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_getattr(
|
||||
struct vfsmount *mnt, struct dentry *d,
|
||||
struct kstat *k)
|
||||
{ return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.getattr = test_getattr,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
||||
|
@ -105,18 +91,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_GETATTR], [
|
|||
[iops->getattr() takes a path])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # Kernel < 4.11 test
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->getattr() takes a vfsmount])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_getattr_vfsmount], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFSMOUNT_IOPS_GETATTR, 1,
|
||||
[iops->getattr() takes a vfsmount])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.7 API change
|
||||
dnl # i_mutex is changed to i_rwsem. Instead of directly using
|
||||
dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
|
||||
dnl # We test inode_lock_shared because inode_lock is introduced earlier.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_LOCK], [
|
||||
ZFS_LINUX_TEST_SRC([inode_lock], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct inode *inode = NULL;
|
||||
inode_lock_shared(inode);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_LOCK], [
|
||||
AC_MSG_CHECKING([whether inode_lock_shared() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_lock], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_LOCK_SHARED, 1, [yes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -42,6 +42,8 @@ AC_DEFUN([ZFS_AC_KERNEL_PERMISSION], [
|
|||
AC_DEFINE(HAVE_IOPS_PERMISSION_IDMAP, 1,
|
||||
[iops->permission() takes struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->permission() takes struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT([permission_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.15 API change
|
||||
dnl # inode_set_flags introduced to set i_flags
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SET_FLAGS], [
|
||||
ZFS_LINUX_TEST_SRC([inode_set_flags], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct inode inode;
|
||||
inode_set_flags(&inode, S_IMMUTABLE, S_IMMUTABLE);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_FLAGS], [
|
||||
AC_MSG_CHECKING([whether inode_set_flags() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_set_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_SET_FLAGS, 1, [inode_set_flags() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,23 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.16 API change
|
||||
dnl # inode_set_iversion introduced to set i_version
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SET_IVERSION], [
|
||||
ZFS_LINUX_TEST_SRC([inode_set_iversion], [
|
||||
#include <linux/iversion.h>
|
||||
],[
|
||||
struct inode inode;
|
||||
inode_set_iversion(&inode, 1);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SET_IVERSION], [
|
||||
AC_MSG_CHECKING([whether inode_set_iversion() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_set_iversion], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_SET_IVERSION, 1,
|
||||
[inode_set_iversion() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -37,19 +37,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_SETATTR], [
|
|||
.setattr = test_setattr,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_setattr], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static int test_setattr(
|
||||
struct dentry *de, struct iattr *ia)
|
||||
{ return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.setattr = test_setattr,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_INODE_SETATTR], [
|
||||
|
@ -73,15 +60,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_SETATTR], [
|
|||
[iops->setattr() takes struct user_namespace*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->setattr() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_setattr], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOPS_SETATTR, 1,
|
||||
[iops->setattr() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -14,20 +14,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_TIMES], [
|
|||
ts = timestamp_truncate(ts, &ip);
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.18 API change
|
||||
dnl # i_atime, i_mtime, and i_ctime changed from timespec to timespec64.
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_SRC([inode_times], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct inode ip;
|
||||
struct timespec ts;
|
||||
|
||||
memset(&ip, 0, sizeof(ip));
|
||||
ts = ip.i_mtime;
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.6 API change
|
||||
dnl # i_ctime no longer directly accessible, must use
|
||||
|
@ -106,15 +92,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_TIMES], [
|
|||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether inode->i_*time's are timespec64])
|
||||
ZFS_LINUX_TEST_RESULT([inode_times], [
|
||||
AC_MSG_RESULT(no)
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_INODE_TIMESPEC64_TIMES, 1,
|
||||
[inode->i_*time's are timespec64])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether inode_get_ctime() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_get_ctime], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
dnl #
|
||||
dnl # grsecurity API change,
|
||||
dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
|
||||
dnl # kmem_cache_create_usercopy().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY], [
|
||||
ZFS_LINUX_TEST_SRC([kmem_cache_create_usercopy], [
|
||||
#include <linux/slab.h>
|
||||
static void ctor(void *foo) { /* fake ctor */ }
|
||||
],[
|
||||
struct kmem_cache *skc_linux_cache;
|
||||
const char *name = "test";
|
||||
size_t size = 4096;
|
||||
size_t align = 8;
|
||||
unsigned long flags = 0;
|
||||
size_t useroffset = 0;
|
||||
size_t usersize = size - useroffset;
|
||||
|
||||
skc_linux_cache = kmem_cache_create_usercopy(
|
||||
name, size, align, flags, useroffset, usersize, ctor);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
|
||||
AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
|
||||
ZFS_LINUX_TEST_RESULT([kmem_cache_create_usercopy], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KMEM_CACHE_CREATE_USERCOPY, 1,
|
||||
[kmem_cache_create_usercopy() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE], [
|
||||
ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE], [
|
||||
ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY
|
||||
])
|
|
@ -57,31 +57,6 @@ AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [
|
|||
AC_MSG_RESULT([$enable_debug_kmem_tracking])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.12 API,
|
||||
dnl # Added kvmalloc allocation strategy
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KVMALLOC], [
|
||||
ZFS_LINUX_TEST_SRC([kvmalloc], [
|
||||
#include <linux/mm.h>
|
||||
#include <linux/slab.h>
|
||||
],[
|
||||
void *p __attribute__ ((unused));
|
||||
|
||||
p = kvmalloc(0, GFP_KERNEL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KVMALLOC], [
|
||||
AC_MSG_CHECKING([whether kvmalloc(ptr, flags) is available])
|
||||
ZFS_LINUX_TEST_RESULT([kvmalloc], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KVMALLOC, 1, [kvmalloc exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.8 API,
|
||||
dnl # __vmalloc PAGE_KERNEL removal
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
dnl #
|
||||
dnl # 2.6.39 API change
|
||||
dnl # Added kstrtoul()
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KSTRTOUL], [
|
||||
ZFS_LINUX_TEST_SRC([kstrtoul], [
|
||||
#include <linux/kernel.h>
|
||||
],[
|
||||
int ret __attribute__ ((unused)) = kstrtoul(NULL, 10, NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KSTRTOUL], [
|
||||
AC_MSG_CHECKING([whether kstrtoul() exists])
|
||||
ZFS_LINUX_TEST_RESULT([kstrtoul], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KSTRTOUL, 1, [kstrtoul() exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([kstrtoul()])
|
||||
])
|
||||
])
|
|
@ -1,55 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.18: ktime_get_coarse_real_ts64() replaces current_kernel_time64().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64], [
|
||||
ZFS_LINUX_TEST_SRC([ktime_get_coarse_real_ts64], [
|
||||
#include <linux/mm.h>
|
||||
], [
|
||||
struct timespec64 ts;
|
||||
ktime_get_coarse_real_ts64(&ts);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64], [
|
||||
AC_MSG_CHECKING([whether ktime_get_coarse_real_ts64() exists])
|
||||
ZFS_LINUX_TEST_RESULT([ktime_get_coarse_real_ts64], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KTIME_GET_COARSE_REAL_TS64, 1,
|
||||
[ktime_get_coarse_real_ts64() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.18: ktime_get_raw_ts64() replaces getrawmonotonic64().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME_GET_RAW_TS64], [
|
||||
ZFS_LINUX_TEST_SRC([ktime_get_raw_ts64], [
|
||||
#include <linux/mm.h>
|
||||
], [
|
||||
struct timespec64 ts;
|
||||
ktime_get_raw_ts64(&ts);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTIME_GET_RAW_TS64], [
|
||||
AC_MSG_CHECKING([whether ktime_get_raw_ts64() exists])
|
||||
ZFS_LINUX_TEST_RESULT([ktime_get_raw_ts64], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KTIME_GET_RAW_TS64, 1,
|
||||
[ktime_get_raw_ts64() exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_KTIME], [
|
||||
ZFS_AC_KERNEL_SRC_KTIME_GET_COARSE_REAL_TS64
|
||||
ZFS_AC_KERNEL_SRC_KTIME_GET_RAW_TS64
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_KTIME], [
|
||||
ZFS_AC_KERNEL_KTIME_GET_COARSE_REAL_TS64
|
||||
ZFS_AC_KERNEL_KTIME_GET_RAW_TS64
|
||||
])
|
|
@ -1,27 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.11 API change
|
||||
dnl # lseek_execute helper exported
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_LSEEK_EXECUTE], [
|
||||
ZFS_LINUX_TEST_SRC([lseek_execute], [
|
||||
#include <linux/fs.h>
|
||||
], [
|
||||
struct file *fp __attribute__ ((unused)) = NULL;
|
||||
struct inode *ip __attribute__ ((unused)) = NULL;
|
||||
loff_t offset __attribute__ ((unused)) = 0;
|
||||
loff_t maxsize __attribute__ ((unused)) = 0;
|
||||
|
||||
lseek_execute(fp, ip, offset, maxsize);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_LSEEK_EXECUTE], [
|
||||
AC_MSG_CHECKING([whether lseek_execute() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lseek_execute],
|
||||
[lseek_exclusive], [fs/read_write.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LSEEK_EXECUTE, 1, [lseek_execute() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -2,14 +2,6 @@ dnl #
|
|||
dnl # Check for make_request_fn interface.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
|
||||
ZFS_LINUX_TEST_SRC([make_request_fn_void], [
|
||||
#include <linux/blkdev.h>
|
||||
static void make_request(struct request_queue *q,
|
||||
struct bio *bio) { return; }
|
||||
],[
|
||||
blk_queue_make_request(NULL, &make_request);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([make_request_fn_blk_qc_t], [
|
||||
#include <linux/blkdev.h>
|
||||
static blk_qc_t make_request(struct request_queue *q,
|
||||
|
@ -197,36 +189,20 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # Linux 3.2 API Change
|
||||
dnl # make_request_fn returns void.
|
||||
dnl # Linux 4.4 API Change
|
||||
dnl # make_request_fn returns blk_qc_t.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether make_request_fn() returns void])
|
||||
ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
|
||||
[whether make_request_fn() returns blk_qc_t])
|
||||
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(MAKE_REQUEST_FN_RET, void,
|
||||
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||
[make_request_fn() return type])
|
||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
|
||||
[Noting that make_request_fn() returns void])
|
||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||
[Noting that make_request_fn() ]
|
||||
[returns blk_qc_t])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.4 API Change
|
||||
dnl # make_request_fn returns blk_qc_t.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether make_request_fn() returns blk_qc_t])
|
||||
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||
[make_request_fn() return type])
|
||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||
[Noting that make_request_fn() ]
|
||||
[returns blk_qc_t])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -68,6 +68,8 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
|||
AC_DEFINE(HAVE_IOPS_MKDIR_IDMAP, 1,
|
||||
[iops->mkdir() takes struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 5.12 API change
|
||||
dnl # The struct user_namespace arg was added as the first argument to
|
||||
|
@ -80,15 +82,6 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR], [
|
|||
[iops->mkdir() takes struct user_namespace*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->mkdir() takes umode_t])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_mkdir], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
|
||||
[iops->mkdir() takes umode_t])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([mkdir()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,55 +1,3 @@
|
|||
dnl #
|
||||
dnl # 3.18 API change,
|
||||
dnl # The function percpu_counter_init now must be passed a GFP mask.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU_COUNTER_INIT], [
|
||||
ZFS_LINUX_TEST_SRC([percpu_counter_init_with_gfp], [
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/percpu_counter.h>
|
||||
],[
|
||||
struct percpu_counter counter;
|
||||
int error;
|
||||
|
||||
error = percpu_counter_init(&counter, 0, GFP_KERNEL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_PERCPU_COUNTER_INIT], [
|
||||
AC_MSG_CHECKING([whether percpu_counter_init() wants gfp_t])
|
||||
ZFS_LINUX_TEST_RESULT([percpu_counter_init_with_gfp], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PERCPU_COUNTER_INIT_WITH_GFP, 1,
|
||||
[percpu_counter_init() wants gfp_t])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.13 API change,
|
||||
dnl # __percpu_counter_add() was renamed to percpu_counter_add_batch().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU_COUNTER_ADD_BATCH], [
|
||||
ZFS_LINUX_TEST_SRC([percpu_counter_add_batch], [
|
||||
#include <linux/percpu_counter.h>
|
||||
],[
|
||||
struct percpu_counter counter;
|
||||
|
||||
percpu_counter_add_batch(&counter, 1, 1);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_PERCPU_COUNTER_ADD_BATCH], [
|
||||
AC_MSG_CHECKING([whether percpu_counter_add_batch() is defined])
|
||||
ZFS_LINUX_TEST_RESULT([percpu_counter_add_batch], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PERCPU_COUNTER_ADD_BATCH, 1,
|
||||
[percpu_counter_add_batch() is defined])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 5.10 API change,
|
||||
dnl # The "count" was moved into ref->data, from ref
|
||||
|
@ -75,13 +23,9 @@ AC_DEFUN([ZFS_AC_KERNEL_PERCPU_REF_COUNT_IN_DATA], [
|
|||
])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU], [
|
||||
ZFS_AC_KERNEL_SRC_PERCPU_COUNTER_INIT
|
||||
ZFS_AC_KERNEL_SRC_PERCPU_COUNTER_ADD_BATCH
|
||||
ZFS_AC_KERNEL_SRC_PERCPU_REF_COUNT_IN_DATA
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_PERCPU], [
|
||||
ZFS_AC_KERNEL_PERCPU_COUNTER_INIT
|
||||
ZFS_AC_KERNEL_PERCPU_COUNTER_ADD_BATCH
|
||||
ZFS_AC_KERNEL_PERCPU_REF_COUNT_IN_DATA
|
||||
])
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
dnl #
|
||||
dnl # Supported symlink APIs
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PUT_LINK], [
|
||||
ZFS_LINUX_TEST_SRC([put_link_cookie], [
|
||||
#include <linux/fs.h>
|
||||
static void put_link(struct inode *ip, void *cookie)
|
||||
{ return; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.put_link = put_link,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([put_link_nameidata], [
|
||||
#include <linux/fs.h>
|
||||
static void put_link(struct dentry *de, struct
|
||||
nameidata *nd, void *ptr) { return; }
|
||||
static struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.put_link = put_link,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_PUT_LINK], [
|
||||
dnl #
|
||||
dnl # 4.5 API change
|
||||
dnl # get_link() uses delayed done, there is no put_link() interface.
|
||||
dnl # This check initially uses the inode_operations_get_link result
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_get_link], [
|
||||
AC_DEFINE(HAVE_PUT_LINK_DELAYED, 1, [iops->put_link() delayed])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.2 API change
|
||||
dnl # This kernel retired the nameidata structure.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether iops->put_link() passes cookie])
|
||||
ZFS_LINUX_TEST_RESULT([put_link_cookie], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PUT_LINK_COOKIE, 1,
|
||||
[iops->put_link() cookie])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.32 API
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether iops->put_link() passes nameidata])
|
||||
ZFS_LINUX_TEST_RESULT([put_link_nameidata], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PUT_LINK_NAMEIDATA, 1,
|
||||
[iops->put_link() nameidata])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([put_link])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -1,23 +1,4 @@
|
|||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME], [
|
||||
dnl #
|
||||
dnl # 3.9 (to 4.9) API change,
|
||||
dnl #
|
||||
dnl # A new version of iops->rename() was added (rename2) that takes a flag
|
||||
dnl # argument (to support renameat2). However this separate function was
|
||||
dnl # merged back into iops->rename() in Linux 4.9.
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_SRC([inode_operations_rename2], [
|
||||
#include <linux/fs.h>
|
||||
static int rename2_fn(struct inode *sip, struct dentry *sdp,
|
||||
struct inode *tip, struct dentry *tdp,
|
||||
unsigned int flags) { return 0; }
|
||||
|
||||
static const struct inode_operations
|
||||
iops __attribute__ ((unused)) = {
|
||||
.rename2 = rename2_fn,
|
||||
};
|
||||
],[])
|
||||
|
||||
dnl #
|
||||
dnl # 4.9 API change,
|
||||
dnl #
|
||||
|
@ -36,24 +17,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_RENAME], [
|
|||
};
|
||||
],[])
|
||||
|
||||
dnl #
|
||||
dnl # EL7 compatibility
|
||||
dnl #
|
||||
dnl # EL7 has backported renameat2 support, but it's done by defining a
|
||||
dnl # separate iops wrapper structure that takes the .renameat2 function.
|
||||
dnl #
|
||||
ZFS_LINUX_TEST_SRC([dir_inode_operations_wrapper_rename2], [
|
||||
#include <linux/fs.h>
|
||||
static int rename2_fn(struct inode *sip, struct dentry *sdp,
|
||||
struct inode *tip, struct dentry *tdp,
|
||||
unsigned int flags) { return 0; }
|
||||
|
||||
static const struct inode_operations_wrapper
|
||||
iops __attribute__ ((unused)) = {
|
||||
.rename2 = rename2_fn,
|
||||
};
|
||||
],[])
|
||||
|
||||
dnl #
|
||||
dnl # 5.12 API change,
|
||||
dnl #
|
||||
|
@ -95,6 +58,8 @@ AC_DEFUN([ZFS_AC_KERNEL_RENAME], [
|
|||
AC_DEFINE(HAVE_IOPS_RENAME_IDMAP, 1,
|
||||
[iops->rename() takes struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->rename() takes struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_rename_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
@ -103,30 +68,13 @@ AC_DEFUN([ZFS_AC_KERNEL_RENAME], [
|
|||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->rename2() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_rename2], [
|
||||
AC_MSG_CHECKING([whether iops->rename() wants flags])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_rename_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RENAME2, 1, [iops->rename2() exists])
|
||||
AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
|
||||
[iops->rename() wants flags])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->rename() wants flags])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_rename_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RENAME_WANTS_FLAGS, 1,
|
||||
[iops->rename() wants flags])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether struct inode_operations_wrapper takes .rename2()])
|
||||
ZFS_LINUX_TEST_RESULT([dir_inode_operations_wrapper_rename2], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RENAME2_OPERATIONS_WRAPPER, 1,
|
||||
[struct inode_operations_wrapper takes .rename2()])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.14 API change
|
||||
dnl # kernel_write() which was introduced in 3.9 was updated to take
|
||||
dnl # the offset as a pointer which is needed by vn_rdwr().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_WRITE], [
|
||||
ZFS_LINUX_TEST_SRC([kernel_write], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct file *file = NULL;
|
||||
const void *buf = NULL;
|
||||
size_t count = 0;
|
||||
loff_t *pos = NULL;
|
||||
ssize_t ret;
|
||||
|
||||
ret = kernel_write(file, buf, count, pos);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
|
||||
AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
|
||||
ZFS_LINUX_TEST_RESULT([kernel_write], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_WRITE_PPOS, 1,
|
||||
[kernel_write() take loff_t pointer])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.14 API change
|
||||
dnl # kernel_read() which has existed for forever was updated to take
|
||||
dnl # the offset as a pointer which is needed by vn_rdwr().
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_READ], [
|
||||
ZFS_LINUX_TEST_SRC([kernel_read], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct file *file = NULL;
|
||||
void *buf = NULL;
|
||||
size_t count = 0;
|
||||
loff_t *pos = NULL;
|
||||
ssize_t ret;
|
||||
|
||||
ret = kernel_read(file, buf, count, pos);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_READ], [
|
||||
AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
|
||||
ZFS_LINUX_TEST_RESULT([kernel_read], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_READ_PPOS, 1,
|
||||
[kernel_read() take loff_t pointer])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RW], [
|
||||
ZFS_AC_KERNEL_SRC_WRITE
|
||||
ZFS_AC_KERNEL_SRC_READ
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_RW], [
|
||||
ZFS_AC_KERNEL_WRITE
|
||||
ZFS_AC_KERNEL_READ
|
||||
])
|
|
@ -1,60 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.16 API Change
|
||||
dnl #
|
||||
dnl # rwsem-spinlock "->activity" changed to "->count"
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY], [
|
||||
ZFS_LINUX_TEST_SRC([rwsem_activity], [
|
||||
#include <linux/rwsem.h>
|
||||
],[
|
||||
struct rw_semaphore dummy_semaphore __attribute__ ((unused));
|
||||
dummy_semaphore.activity = 0;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ACTIVITY], [
|
||||
AC_MSG_CHECKING([whether struct rw_semaphore has member activity])
|
||||
ZFS_LINUX_TEST_RESULT([rwsem_activity], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RWSEM_ACTIVITY, 1,
|
||||
[struct rw_semaphore has member activity])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.8 API Change
|
||||
dnl #
|
||||
dnl # rwsem "->count" changed to atomic_long_t type
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT], [
|
||||
ZFS_LINUX_TEST_SRC([rwsem_atomic_long_count], [
|
||||
#include <linux/rwsem.h>
|
||||
],[
|
||||
DECLARE_RWSEM(dummy_semaphore);
|
||||
(void) atomic_long_read(&dummy_semaphore.count);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT], [
|
||||
AC_MSG_CHECKING(
|
||||
[whether struct rw_semaphore has atomic_long_t member count])
|
||||
ZFS_LINUX_TEST_RESULT([rwsem_atomic_long_count], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1,
|
||||
[struct rw_semaphore has atomic_long_t member count])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
|
||||
ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
|
||||
ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
|
||||
ZFS_AC_KERNEL_RWSEM_ACTIVITY
|
||||
ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
|
||||
])
|
|
@ -20,63 +20,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SCHED_RT_HEADER], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.11 API change,
|
||||
dnl # Moved things from linux/sched.h to linux/sched/signal.h
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SCHED_SIGNAL_HEADER], [
|
||||
ZFS_LINUX_TEST_SRC([sched_signal_header], [
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/signal.h>
|
||||
],[
|
||||
return 0;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SCHED_SIGNAL_HEADER], [
|
||||
AC_MSG_CHECKING([whether header linux/sched/signal.h exists])
|
||||
ZFS_LINUX_TEST_RESULT([sched_signal_header], [
|
||||
AC_DEFINE(HAVE_SCHED_SIGNAL_HEADER, 1,
|
||||
[linux/sched/signal.h exists])
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.19 API change
|
||||
dnl # The io_schedule_timeout() function is present in all 2.6.32 kernels
|
||||
dnl # but it was not exported until Linux 3.19. The RHEL 7.x kernels which
|
||||
dnl # are based on a 3.10 kernel do export this symbol.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_IO_SCHEDULE_TIMEOUT], [
|
||||
ZFS_LINUX_TEST_SRC([io_schedule_timeout], [
|
||||
#include <linux/sched.h>
|
||||
], [
|
||||
(void) io_schedule_timeout(1);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_IO_SCHEDULE_TIMEOUT], [
|
||||
AC_MSG_CHECKING([whether io_schedule_timeout() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([io_schedule_timeout],
|
||||
[io_schedule_timeout], [], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IO_SCHEDULE_TIMEOUT, 1, [yes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SCHED], [
|
||||
ZFS_AC_KERNEL_SRC_SCHED_RT_HEADER
|
||||
ZFS_AC_KERNEL_SRC_SCHED_SIGNAL_HEADER
|
||||
ZFS_AC_KERNEL_SRC_IO_SCHEDULE_TIMEOUT
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SCHED], [
|
||||
ZFS_AC_KERNEL_SCHED_RT_HEADER
|
||||
ZFS_AC_KERNEL_SCHED_SIGNAL_HEADER
|
||||
ZFS_AC_KERNEL_IO_SCHEDULE_TIMEOUT
|
||||
])
|
||||
|
|
|
@ -51,6 +51,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE], [
|
|||
AC_DEFINE(HAVE_SETATTR_PREPARE_IDMAP, 1,
|
||||
[setattr_prepare() accepts mnt_idmap])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether setattr_prepare() is available and accepts struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([setattr_prepare_userns],
|
||||
[setattr_prepare], [fs/attr.c], [
|
||||
|
|
|
@ -58,31 +58,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK], [
|
|||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.12 API change
|
||||
dnl # The nid member was added to struct shrink_control to support
|
||||
dnl # NUMA-aware shrinkers.
|
||||
dnl # 6.0 API change
|
||||
dnl # register_shrinker() becomes a var-arg function that takes
|
||||
dnl # a printf-style format string as args > 0
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_HAS_NID], [
|
||||
ZFS_LINUX_TEST_SRC([shrink_control_nid], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct shrink_control sc __attribute__ ((unused));
|
||||
unsigned long scnidsize __attribute__ ((unused)) =
|
||||
sizeof(sc.nid);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID], [
|
||||
AC_MSG_CHECKING([whether shrink_control has nid])
|
||||
ZFS_LINUX_TEST_RESULT([shrink_control_nid], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(SHRINK_CONTROL_HAS_NID, 1,
|
||||
[struct shrink_control has nid])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG], [
|
||||
ZFS_LINUX_TEST_SRC([register_shrinker_vararg], [
|
||||
#include <linux/mm.h>
|
||||
|
@ -98,30 +77,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG], [
|
|||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK], [
|
||||
ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control], [
|
||||
#include <linux/mm.h>
|
||||
static int shrinker_cb(struct shrinker *shrink,
|
||||
struct shrink_control *sc) { return 0; }
|
||||
AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SHRINKER_VARARG],[
|
||||
AC_MSG_CHECKING([whether new var-arg register_shrinker() exists])
|
||||
ZFS_LINUX_TEST_RESULT([register_shrinker_vararg], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REGISTER_SHRINKER_VARARG, 1,
|
||||
[register_shrinker is vararg])
|
||||
],[
|
||||
struct shrinker cache_shrinker = {
|
||||
.shrink = shrinker_cb,
|
||||
.seeks = DEFAULT_SEEKS,
|
||||
};
|
||||
register_shrinker(&cache_shrinker);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control_split], [
|
||||
#include <linux/mm.h>
|
||||
static unsigned long shrinker_cb(struct shrinker *shrink,
|
||||
struct shrink_control *sc) { return 0; }
|
||||
],[
|
||||
struct shrinker cache_shrinker = {
|
||||
.count_objects = shrinker_cb,
|
||||
.scan_objects = shrinker_cb,
|
||||
.seeks = DEFAULT_SEEKS,
|
||||
};
|
||||
register_shrinker(&cache_shrinker);
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
|
@ -144,117 +107,25 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_REGISTER], [
|
|||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[
|
||||
dnl #
|
||||
dnl # 6.0 API change
|
||||
dnl # register_shrinker() becomes a var-arg function that takes
|
||||
dnl # a printf-style format string as args > 0
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether new var-arg register_shrinker() exists])
|
||||
ZFS_LINUX_TEST_RESULT([register_shrinker_vararg], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_REGISTER], [
|
||||
AC_MSG_CHECKING([whether shrinker_register() exists])
|
||||
ZFS_LINUX_TEST_RESULT([shrinker_register], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_REGISTER_SHRINKER_VARARG, 1,
|
||||
[register_shrinker is vararg])
|
||||
|
||||
dnl # We assume that the split shrinker callback exists if the
|
||||
dnl # vararg register_shrinker() exists, because the latter is
|
||||
dnl # a much more recent addition, and the macro test for the
|
||||
dnl # var-arg version only works if the callback is split
|
||||
AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1,
|
||||
[cs->count_objects exists])
|
||||
],[
|
||||
AC_DEFINE(HAVE_SHRINKER_REGISTER, 1, [shrinker_register exists])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
dnl #
|
||||
dnl # 3.0 - 3.11 API change
|
||||
dnl # cs->shrink(struct shrinker *, struct shrink_control *sc)
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether new 2-argument shrinker exists])
|
||||
ZFS_LINUX_TEST_RESULT([shrinker_cb_shrink_control], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SINGLE_SHRINKER_CALLBACK, 1,
|
||||
[new shrinker callback wants 2 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 3.12 API change,
|
||||
dnl # cs->shrink() is logically split in to
|
||||
dnl # cs->count_objects() and cs->scan_objects()
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether cs->count_objects callback exists])
|
||||
ZFS_LINUX_TEST_RESULT(
|
||||
[shrinker_cb_shrink_control_split],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1,
|
||||
[cs->count_objects exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING(
|
||||
[whether shrinker_register exists])
|
||||
ZFS_LINUX_TEST_RESULT([shrinker_register], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SHRINKER_REGISTER, 1,
|
||||
[shrinker_register exists])
|
||||
|
||||
dnl # We assume that the split shrinker
|
||||
dnl # callback exists if
|
||||
dnl # shrinker_register() exists,
|
||||
dnl # because the latter is a much more
|
||||
dnl # recent addition, and the macro
|
||||
dnl # test for shrinker_register() only
|
||||
dnl # works if the callback is split
|
||||
AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK,
|
||||
1, [cs->count_objects exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
ZFS_LINUX_TEST_ERROR([shrinker])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.39 API change,
|
||||
dnl # Shrinker adjust to use common shrink_control structure.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_STRUCT], [
|
||||
ZFS_LINUX_TEST_SRC([shrink_control_struct], [
|
||||
#include <linux/mm.h>
|
||||
],[
|
||||
struct shrink_control sc __attribute__ ((unused));
|
||||
|
||||
sc.nr_to_scan = 0;
|
||||
sc.gfp_mask = GFP_KERNEL;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_STRUCT], [
|
||||
AC_MSG_CHECKING([whether struct shrink_control exists])
|
||||
ZFS_LINUX_TEST_RESULT([shrink_control_struct], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1,
|
||||
[struct shrink_control exists])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([shrink_control])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER], [
|
||||
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK
|
||||
ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK_PTR
|
||||
ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_HAS_NID
|
||||
ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK
|
||||
ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_STRUCT
|
||||
ZFS_AC_KERNEL_SRC_REGISTER_SHRINKER_VARARG
|
||||
ZFS_AC_KERNEL_SRC_SHRINKER_REGISTER
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SHRINKER], [
|
||||
ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK
|
||||
ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID
|
||||
ZFS_AC_KERNEL_SHRINKER_CALLBACK
|
||||
ZFS_AC_KERNEL_SHRINK_CONTROL_STRUCT
|
||||
ZFS_AC_KERNEL_REGISTER_SHRINKER_VARARG
|
||||
ZFS_AC_KERNEL_SHRINKER_REGISTER
|
||||
])
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.4 API change
|
||||
dnl # Added kernel_signal_stop
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SIGNAL_STOP], [
|
||||
ZFS_LINUX_TEST_SRC([signal_stop], [
|
||||
#include <linux/sched/signal.h>
|
||||
],[
|
||||
kernel_signal_stop();
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SIGNAL_STOP], [
|
||||
AC_MSG_CHECKING([whether signal_stop() exists])
|
||||
ZFS_LINUX_TEST_RESULT([signal_stop], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SIGNAL_STOP, 1, [signal_stop() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,21 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.17 API change
|
||||
dnl # Added set_special_state() function
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE], [
|
||||
ZFS_LINUX_TEST_SRC([set_special_state], [
|
||||
#include <linux/sched.h>
|
||||
],[
|
||||
set_special_state(TASK_STOPPED);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SET_SPECIAL_STATE], [
|
||||
AC_MSG_CHECKING([whether set_special_state() exists])
|
||||
ZFS_LINUX_TEST_RESULT([set_special_state], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_SPECIAL_STATE, 1, [set_special_state() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,6 +1,5 @@
|
|||
dnl #
|
||||
dnl # 6.8.x replaced strlcpy with strscpy. Check for both so we can provide
|
||||
dnl # appropriate fallbacks.
|
||||
dnl # 6.8 removed strlcpy.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_STRLCPY], [
|
||||
ZFS_LINUX_TEST_SRC([kernel_has_strlcpy], [
|
||||
|
@ -13,17 +12,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_STRLCPY], [
|
|||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_STRSCPY], [
|
||||
ZFS_LINUX_TEST_SRC([kernel_has_strscpy], [
|
||||
#include <linux/string.h>
|
||||
], [
|
||||
const char *src = "goodbye";
|
||||
char dst[32];
|
||||
ssize_t len;
|
||||
len = strscpy(dst, src, sizeof (dst));
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_STRLCPY], [
|
||||
AC_MSG_CHECKING([whether strlcpy() exists])
|
||||
ZFS_LINUX_TEST_RESULT([kernel_has_strlcpy], [
|
||||
|
@ -34,14 +22,3 @@ AC_DEFUN([ZFS_AC_KERNEL_STRLCPY], [
|
|||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_STRSCPY], [
|
||||
AC_MSG_CHECKING([whether strscpy() exists])
|
||||
ZFS_LINUX_TEST_RESULT([kernel_has_strscpy], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_KERNEL_STRSCPY, 1,
|
||||
[strscpy() exists])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.8 API change
|
||||
dnl # struct user_namespace was added to struct super_block as
|
||||
dnl # super->s_user_ns member
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SUPER_USER_NS], [
|
||||
ZFS_LINUX_TEST_SRC([super_user_ns], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/user_namespace.h>
|
||||
], [
|
||||
struct super_block super;
|
||||
super.s_user_ns = (struct user_namespace *)NULL;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SUPER_USER_NS], [
|
||||
AC_MSG_CHECKING([whether super_block->s_user_ns exists])
|
||||
ZFS_LINUX_TEST_RESULT([super_user_ns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SUPER_USER_NS, 1,
|
||||
[super_block->s_user_ns exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -41,6 +41,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SYMLINK], [
|
|||
AC_DEFINE(HAVE_IOPS_SYMLINK_IDMAP, 1,
|
||||
[iops->symlink() takes struct mnt_idmap*])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether iops->symlink() takes struct user_namespace*])
|
||||
ZFS_LINUX_TEST_RESULT([symlink_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
dnl # 4.14-rc3 API change
|
||||
dnl # https://lwn.net/Articles/735887/
|
||||
dnl #
|
||||
dnl # Check if timer_list.func get passed a timer_list or an unsigned long
|
||||
dnl # (older kernels). Also sanity check the from_timer() and timer_setup()
|
||||
dnl # macros are available as well, since they will be used in the same newer
|
||||
dnl # kernels that support the new timer_list.func signature.
|
||||
dnl #
|
||||
dnl # Also check for the existence of flags in struct timer_list, they were
|
||||
dnl # added in 4.1-rc8 via 0eeda71bc30d.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_TIMER_SETUP], [
|
||||
ZFS_LINUX_TEST_SRC([timer_setup], [
|
||||
#include <linux/timer.h>
|
||||
|
||||
struct my_task_timer {
|
||||
struct timer_list timer;
|
||||
int data;
|
||||
};
|
||||
|
||||
static void task_expire(struct timer_list *tl)
|
||||
{
|
||||
struct my_task_timer *task_timer =
|
||||
from_timer(task_timer, tl, timer);
|
||||
task_timer->data = 42;
|
||||
}
|
||||
],[
|
||||
struct my_task_timer task_timer;
|
||||
timer_setup(&task_timer.timer, task_expire, 0);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([timer_list_function], [
|
||||
#include <linux/timer.h>
|
||||
static void task_expire(struct timer_list *tl) {}
|
||||
],[
|
||||
struct timer_list tl;
|
||||
tl.function = task_expire;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([timer_list_flags], [
|
||||
#include <linux/timer.h>
|
||||
],[
|
||||
struct timer_list tl;
|
||||
tl.flags = 2;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_TIMER_SETUP], [
|
||||
AC_MSG_CHECKING([whether timer_setup() is available])
|
||||
ZFS_LINUX_TEST_RESULT([timer_setup], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_TIMER_SETUP, 1,
|
||||
[timer_setup() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether timer function expects timer_list])
|
||||
ZFS_LINUX_TEST_RESULT([timer_list_function], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST, 1,
|
||||
[timer_list.function gets a timer_list])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether struct timer_list has flags])
|
||||
ZFS_LINUX_TEST_RESULT([timer_list_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KERNEL_TIMER_LIST_FLAGS, 1,
|
||||
[struct timer_list has a flags member])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -59,23 +59,19 @@ AC_DEFUN([ZFS_AC_KERNEL_TMPFILE], [
|
|||
AC_MSG_CHECKING([whether i_op->tmpfile() exists])
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_mnt_idmap], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||
AC_DEFINE(HAVE_TMPFILE_IDMAP, 1, [i_op->tmpfile() has mnt_idmap])
|
||||
], [
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||
AC_DEFINE(HAVE_TMPFILE_USERNS, 1, [i_op->tmpfile() has userns])
|
||||
AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
|
||||
],[
|
||||
ZFS_LINUX_TEST_RESULT([inode_operations_tmpfile_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_TMPFILE, 1, [i_op->tmpfile() exists])
|
||||
AC_DEFINE(HAVE_TMPFILE_DENTRY, 1, [i_op->tmpfile() uses old dentry signature])
|
||||
],[
|
||||
ZFS_LINUX_REQUIRE_API([i_op->tmpfile()], [3.11])
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
dnl #
|
||||
dnl # 3.18 API change
|
||||
dnl # struct user_namespace inum moved from .proc_inum to .ns.inum.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_USER_NS_COMMON_INUM], [
|
||||
ZFS_LINUX_TEST_SRC([user_ns_common_inum], [
|
||||
#include <linux/user_namespace.h>
|
||||
], [
|
||||
struct user_namespace uns;
|
||||
uns.ns.inum = 0;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_USER_NS_COMMON_INUM], [
|
||||
AC_MSG_CHECKING([whether user_namespace->ns.inum exists])
|
||||
ZFS_LINUX_TEST_RESULT([user_ns_common_inum], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_USER_NS_COMMON_INUM, 1,
|
||||
[user_namespace->ns.inum exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -19,33 +19,6 @@ AC_DEFUN([ZFS_AC_KERNEL_NS_CAPABLE], [
|
|||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.10 API change
|
||||
dnl # has_capability() was exported.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_HAS_CAPABILITY], [
|
||||
ZFS_LINUX_TEST_SRC([has_capability], [
|
||||
#include <linux/capability.h>
|
||||
],[
|
||||
struct task_struct *task = NULL;
|
||||
int cap = 0;
|
||||
bool result __attribute__ ((unused));
|
||||
|
||||
result = has_capability(task, cap);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_HAS_CAPABILITY], [
|
||||
AC_MSG_CHECKING([whether has_capability() is available])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL([has_capability],
|
||||
[has_capability], [kernel/capability.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_HAS_CAPABILITY, 1, [has_capability() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.39 API change
|
||||
dnl # struct user_namespace was added to struct cred_t as cred->user_ns member
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
dnl #
|
||||
dnl # Check for direct IO interfaces.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO], [
|
||||
ZFS_LINUX_TEST_SRC([direct_io_iter], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_direct_IO(struct kiocb *kiocb,
|
||||
struct iov_iter *iter) { return 0; }
|
||||
|
||||
static const struct address_space_operations
|
||||
aops __attribute__ ((unused)) = {
|
||||
.direct_IO = test_direct_IO,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([direct_io_iter_offset], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_direct_IO(struct kiocb *kiocb,
|
||||
struct iov_iter *iter, loff_t offset) { return 0; }
|
||||
|
||||
static const struct address_space_operations
|
||||
aops __attribute__ ((unused)) = {
|
||||
.direct_IO = test_direct_IO,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([direct_io_iter_rw_offset], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_direct_IO(int rw, struct kiocb *kiocb,
|
||||
struct iov_iter *iter, loff_t offset) { return 0; }
|
||||
|
||||
static const struct address_space_operations
|
||||
aops __attribute__ ((unused)) = {
|
||||
.direct_IO = test_direct_IO,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([direct_io_iovec], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_direct_IO(int rw, struct kiocb *kiocb,
|
||||
const struct iovec *iov, loff_t offset,
|
||||
unsigned long nr_segs) { return 0; }
|
||||
|
||||
static const struct address_space_operations
|
||||
aops __attribute__ ((unused)) = {
|
||||
.direct_IO = test_direct_IO,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_DIRECT_IO], [
|
||||
dnl #
|
||||
dnl # Linux 4.6.x API change
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether aops->direct_IO() uses iov_iter])
|
||||
ZFS_LINUX_TEST_RESULT([direct_io_iter], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER, 1,
|
||||
[aops->direct_IO() uses iov_iter without rw])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.1.x API change
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether aops->direct_IO() uses offset])
|
||||
ZFS_LINUX_TEST_RESULT([direct_io_iter_offset], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_OFFSET, 1,
|
||||
[aops->direct_IO() uses iov_iter with offset])
|
||||
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 3.16.x API change
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether aops->direct_IO() uses rw and offset])
|
||||
ZFS_LINUX_TEST_RESULT([direct_io_iter_rw_offset], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET, 1,
|
||||
[aops->direct_IO() uses iov_iter with ]
|
||||
[rw and offset])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
dnl #
|
||||
dnl # Ancient Linux API (predates git)
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether aops->direct_IO() uses iovec])
|
||||
ZFS_LINUX_TEST_RESULT([direct_io_iovec], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_VFS_DIRECT_IO_IOVEC, 1,
|
||||
[aops->direct_IO() uses iovec])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([direct IO])
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -1,50 +0,0 @@
|
|||
dnl #
|
||||
dnl # EL7 have backported copy_file_range and clone_file_range and
|
||||
dnl # added them to an "extended" file_operations struct.
|
||||
dnl #
|
||||
dnl # We're testing for both functions in one here, because they will only
|
||||
dnl # ever appear together and we don't want to match a similar method in
|
||||
dnl # some future vendor kernel.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_file_operations_extend], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_copy_file_range(struct file *src_file,
|
||||
loff_t src_off, struct file *dst_file, loff_t dst_off,
|
||||
size_t len, unsigned int flags) {
|
||||
(void) src_file; (void) src_off;
|
||||
(void) dst_file; (void) dst_off;
|
||||
(void) len; (void) flags;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int test_clone_file_range(struct file *src_file,
|
||||
loff_t src_off, struct file *dst_file, loff_t dst_off,
|
||||
u64 len) {
|
||||
(void) src_file; (void) src_off;
|
||||
(void) dst_file; (void) dst_off;
|
||||
(void) len;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static const struct file_operations_extend
|
||||
fops __attribute__ ((unused)) = {
|
||||
.kabi_fops = {},
|
||||
.copy_file_range = test_copy_file_range,
|
||||
.clone_file_range = test_clone_file_range,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND], [
|
||||
AC_MSG_CHECKING([whether file_operations_extend takes \
|
||||
.copy_file_range() and .clone_file_range()])
|
||||
ZFS_LINUX_TEST_RESULT([vfs_file_operations_extend], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_VFS_FILE_OPERATIONS_EXTEND, 1,
|
||||
[file_operations_extend takes .copy_file_range()
|
||||
and .clone_file_range()])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
|
@ -19,36 +19,6 @@ dnl #
|
|||
dnl # 6.8: generic_copy_file_range() removed, replaced by
|
||||
dnl # splice_copy_file_range()
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_COPY_FILE_RANGE], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_copy_file_range], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_copy_file_range(struct file *src_file,
|
||||
loff_t src_off, struct file *dst_file, loff_t dst_off,
|
||||
size_t len, unsigned int flags) {
|
||||
(void) src_file; (void) src_off;
|
||||
(void) dst_file; (void) dst_off;
|
||||
(void) len; (void) flags;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.copy_file_range = test_copy_file_range,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_COPY_FILE_RANGE], [
|
||||
AC_MSG_CHECKING([whether fops->copy_file_range() is available])
|
||||
ZFS_LINUX_TEST_RESULT([vfs_copy_file_range], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_VFS_COPY_FILE_RANGE, 1,
|
||||
[fops->copy_file_range() is available])
|
||||
],[
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE], [
|
||||
ZFS_LINUX_TEST_SRC([generic_copy_file_range], [
|
||||
#include <linux/fs.h>
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.11 API, a528d35e@torvalds/linux
|
||||
dnl # vfs_getattr(const struct path *p, struct kstat *s, u32 m, unsigned int f)
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GETATTR_4ARGS], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_getattr_4args], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
vfs_getattr((const struct path *)NULL,
|
||||
(struct kstat *)NULL,
|
||||
(u32)0,
|
||||
(unsigned int)0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_GETATTR_4ARGS], [
|
||||
AC_MSG_CHECKING([whether vfs_getattr() wants 4 args])
|
||||
ZFS_LINUX_TEST_RESULT([vfs_getattr_4args], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_4ARGS_VFS_GETATTR, 1,
|
||||
[vfs_getattr wants 4 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.9 API
|
||||
dnl # vfs_getattr(struct path *p, struct kstat *s)
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GETATTR_2ARGS], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_getattr_2args], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
vfs_getattr((struct path *) NULL,
|
||||
(struct kstat *)NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_GETATTR_2ARGS], [
|
||||
AC_MSG_CHECKING([whether vfs_getattr() wants 2 args])
|
||||
ZFS_LINUX_TEST_RESULT([vfs_getattr_2args], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_VFS_GETATTR, 1,
|
||||
[vfs_getattr wants 2 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # <3.9 API
|
||||
dnl # vfs_getattr(struct vfsmount *v, struct dentry *d, struct kstat *k)
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GETATTR_3ARGS], [
|
||||
ZFS_LINUX_TEST_SRC([vfs_getattr_3args], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
vfs_getattr((struct vfsmount *)NULL,
|
||||
(struct dentry *)NULL,
|
||||
(struct kstat *)NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_GETATTR_3ARGS], [
|
||||
AC_MSG_CHECKING([whether vfs_getattr() wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT([vfs_getattr_3args], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_VFS_GETATTR, 1,
|
||||
[vfs_getattr wants 3 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GETATTR], [
|
||||
ZFS_AC_KERNEL_SRC_VFS_GETATTR_4ARGS
|
||||
ZFS_AC_KERNEL_SRC_VFS_GETATTR_2ARGS
|
||||
ZFS_AC_KERNEL_SRC_VFS_GETATTR_3ARGS
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_GETATTR], [
|
||||
ZFS_AC_KERNEL_VFS_GETATTR_4ARGS
|
||||
ZFS_AC_KERNEL_VFS_GETATTR_2ARGS
|
||||
ZFS_AC_KERNEL_VFS_GETATTR_3ARGS
|
||||
])
|
|
@ -2,44 +2,6 @@ dnl #
|
|||
dnl # Check for available iov_iter functionality.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_types], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
int type __attribute__ ((unused)) = ITER_KVEC;
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_advance], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
struct iov_iter iter = { 0 };
|
||||
size_t advance = 512;
|
||||
|
||||
iov_iter_advance(&iter, advance);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_revert], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
struct iov_iter iter = { 0 };
|
||||
size_t revert = 512;
|
||||
|
||||
iov_iter_revert(&iter, revert);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_fault_in_readable], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
struct iov_iter iter = { 0 };
|
||||
size_t size = 512;
|
||||
int error __attribute__ ((unused));
|
||||
|
||||
error = iov_iter_fault_in_readable(&iter, size);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([fault_in_iov_iter_readable], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
|
@ -51,40 +13,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
|||
error = fault_in_iov_iter_readable(&iter, size);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_count], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
struct iov_iter iter = { 0 };
|
||||
size_t bytes __attribute__ ((unused));
|
||||
|
||||
bytes = iov_iter_count(&iter);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([copy_to_iter], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
struct iov_iter iter = { 0 };
|
||||
char buf[512] = { 0 };
|
||||
size_t size = 512;
|
||||
size_t bytes __attribute__ ((unused));
|
||||
|
||||
bytes = copy_to_iter((const void *)&buf, size, &iter);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([copy_from_iter], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
],[
|
||||
struct iov_iter iter = { 0 };
|
||||
char buf[512] = { 0 };
|
||||
size_t size = 512;
|
||||
size_t bytes __attribute__ ((unused));
|
||||
|
||||
bytes = copy_from_iter((void *)&buf, size, &iter);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([iov_iter_type], [
|
||||
#include <linux/fs.h>
|
||||
#include <linux/uio.h>
|
||||
|
@ -105,80 +33,11 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
|||
AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
||||
enable_vfs_iov_iter="yes"
|
||||
|
||||
AC_MSG_CHECKING([whether iov_iter types are available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_types], [
|
||||
AC_MSG_CHECKING([whether fault_in_iov_iter_readable() is available])
|
||||
ZFS_LINUX_TEST_RESULT([fault_in_iov_iter_readable], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_TYPES, 1,
|
||||
[iov_iter types are available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether iov_iter_advance() is available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_advance], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_ADVANCE, 1,
|
||||
[iov_iter_advance() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether iov_iter_revert() is available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_revert], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_REVERT, 1,
|
||||
[iov_iter_revert() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether iov_iter_fault_in_readable() is available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_fault_in_readable], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_FAULT_IN_READABLE, 1,
|
||||
[iov_iter_fault_in_readable() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
AC_MSG_CHECKING([whether fault_in_iov_iter_readable() is available])
|
||||
ZFS_LINUX_TEST_RESULT([fault_in_iov_iter_readable], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_FAULT_IN_IOV_ITER_READABLE, 1,
|
||||
[fault_in_iov_iter_readable() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether iov_iter_count() is available])
|
||||
ZFS_LINUX_TEST_RESULT([iov_iter_count], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_IOV_ITER_COUNT, 1,
|
||||
[iov_iter_count() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether copy_to_iter() is available])
|
||||
ZFS_LINUX_TEST_RESULT([copy_to_iter], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_COPY_TO_ITER, 1,
|
||||
[copy_to_iter() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([whether copy_from_iter() is available])
|
||||
ZFS_LINUX_TEST_RESULT([copy_from_iter], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_COPY_FROM_ITER, 1,
|
||||
[copy_from_iter() is available])
|
||||
AC_DEFINE(HAVE_FAULT_IN_IOV_ITER_READABLE, 1,
|
||||
[fault_in_iov_iter_readable() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
enable_vfs_iov_iter="no"
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_ITERATE], [
|
||||
ZFS_LINUX_TEST_SRC([file_operations_iterate_shared], [
|
||||
#include <linux/fs.h>
|
||||
static int iterate(struct file *filp, struct dir_context * context)
|
||||
{ return 0; }
|
||||
|
||||
static const struct file_operations fops
|
||||
__attribute__ ((unused)) = {
|
||||
.iterate_shared = iterate,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([file_operations_iterate], [
|
||||
#include <linux/fs.h>
|
||||
static int iterate(struct file *filp,
|
||||
struct dir_context *context) { return 0; }
|
||||
|
||||
static const struct file_operations fops
|
||||
__attribute__ ((unused)) = {
|
||||
.iterate = iterate,
|
||||
};
|
||||
|
||||
#if defined(FMODE_KABI_ITERATE)
|
||||
#error "RHEL 7.5, FMODE_KABI_ITERATE interface"
|
||||
#endif
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([file_operations_readdir], [
|
||||
#include <linux/fs.h>
|
||||
static int readdir(struct file *filp, void *entry,
|
||||
filldir_t func) { return 0; }
|
||||
|
||||
static const struct file_operations fops
|
||||
__attribute__ ((unused)) = {
|
||||
.readdir = readdir,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_ITERATE], [
|
||||
dnl #
|
||||
dnl # 4.7 API change
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->iterate_shared() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_operations_iterate_shared], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFS_ITERATE_SHARED, 1,
|
||||
[fops->iterate_shared() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 3.11 API change
|
||||
dnl #
|
||||
dnl # RHEL 7.5 compatibility; the fops.iterate() method was
|
||||
dnl # added to the file_operations structure but in order to
|
||||
dnl # maintain KABI compatibility all callers must set
|
||||
dnl # FMODE_KABI_ITERATE which is checked in iterate_dir().
|
||||
dnl # When detected ignore this interface and fallback to
|
||||
dnl # to using fops.readdir() to retain KABI compatibility.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->iterate() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_operations_iterate], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFS_ITERATE, 1,
|
||||
[fops->iterate() is available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # readdir interface introduced
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether fops->readdir() is available])
|
||||
ZFS_LINUX_TEST_RESULT([file_operations_readdir], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFS_READDIR, 1,
|
||||
[fops->readdir() is available])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([vfs_iterate])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
|
@ -1,80 +0,0 @@
|
|||
dnl #
|
||||
dnl # Linux 3.16 API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE], [
|
||||
ZFS_LINUX_TEST_SRC([file_operations_rw], [
|
||||
#include <linux/fs.h>
|
||||
|
||||
static ssize_t test_read(struct kiocb *kiocb, struct iov_iter *to)
|
||||
{ return 0; }
|
||||
static ssize_t test_write(struct kiocb *kiocb, struct iov_iter *from)
|
||||
{ return 0; }
|
||||
|
||||
static const struct file_operations
|
||||
fops __attribute__ ((unused)) = {
|
||||
.read_iter = test_read,
|
||||
.write_iter = test_write,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([new_sync_rw], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
ssize_t ret __attribute__ ((unused));
|
||||
struct file *filp = NULL;
|
||||
char __user *rbuf = NULL;
|
||||
const char __user *wbuf = NULL;
|
||||
size_t len = 0;
|
||||
loff_t ppos;
|
||||
|
||||
ret = new_sync_read(filp, rbuf, len, &ppos);
|
||||
ret = new_sync_write(filp, wbuf, len, &ppos);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_RW_ITERATE], [
|
||||
AC_MSG_CHECKING([whether fops->read/write_iter() are available])
|
||||
ZFS_LINUX_TEST_RESULT([file_operations_rw], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_VFS_RW_ITERATE, 1,
|
||||
[fops->read/write_iter() are available])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.1 API
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether new_sync_read/write() are available])
|
||||
ZFS_LINUX_TEST_RESULT([new_sync_rw], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_NEW_SYNC_READ, 1,
|
||||
[new_sync_read()/new_sync_write() are available])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Linux 4.1.x API
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS], [
|
||||
ZFS_LINUX_TEST_SRC([generic_write_checks], [
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
struct kiocb *iocb = NULL;
|
||||
struct iov_iter *iov = NULL;
|
||||
generic_write_checks(iocb, iov);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS], [
|
||||
AC_MSG_CHECKING([whether generic_write_checks() takes kiocb])
|
||||
ZFS_LINUX_TEST_RESULT([generic_write_checks], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_WRITE_CHECKS_KIOCB, 1,
|
||||
[generic_write_checks() takes kiocb])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
|
@ -1,99 +0,0 @@
|
|||
dnl #
|
||||
dnl # 4.13 API change
|
||||
dnl # Renamed struct wait_queue -> struct wait_queue_entry.
|
||||
dnl #
|
||||
dnl # N.B. The type check is performed before all other checks
|
||||
dnl # since ZFS_AC_KERNEL_SRC_WAIT_QUEUE_HEAD_ENTRY depends on
|
||||
dnl # HAVE_WAIT_QUEUE_ENTRY_T being set in confdefs.h.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_WAIT_QUEUE_ENTRY_T], [
|
||||
AC_MSG_CHECKING([whether wait_queue_entry_t exists])
|
||||
ZFS_LINUX_TRY_COMPILE([
|
||||
#include <linux/wait.h>
|
||||
],[
|
||||
wait_queue_entry_t *entry __attribute__ ((unused));
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY_T, 1,
|
||||
[wait_queue_entry_t exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.17 API change,
|
||||
dnl # wait_on_bit() no longer requires an action argument. The former
|
||||
dnl # "wait_on_bit" interface required an 'action' function to be provided
|
||||
dnl # which does the actual waiting. There were over 20 such functions in the
|
||||
dnl # kernel, many of them identical, though most cases can be satisfied by one
|
||||
dnl # of just two functions: one which uses io_schedule() and one which just
|
||||
dnl # uses schedule(). This API change was made to consolidate all of those
|
||||
dnl # redundant wait functions.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_WAIT_ON_BIT], [
|
||||
ZFS_LINUX_TEST_SRC([wait_on_bit], [
|
||||
#include <linux/wait.h>
|
||||
],[
|
||||
int (*action)(void *) = NULL;
|
||||
wait_on_bit(NULL, 0, action, 0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_WAIT_ON_BIT], [
|
||||
AC_MSG_CHECKING([whether wait_on_bit() takes an action])
|
||||
ZFS_LINUX_TEST_RESULT([wait_on_bit], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_WAIT_ON_BIT_ACTION, 1, [yes])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.13 API change
|
||||
dnl # Renamed wait_queue_head::task_list -> wait_queue_head::head
|
||||
dnl # Renamed wait_queue_entry::task_list -> wait_queue_entry::entry
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_WAIT_QUEUE_HEAD_ENTRY], [
|
||||
ZFS_LINUX_TEST_SRC([wait_queue_head_entry], [
|
||||
#include <linux/wait.h>
|
||||
|
||||
#ifdef HAVE_WAIT_QUEUE_ENTRY_T
|
||||
typedef wait_queue_head_t spl_wait_queue_head_t;
|
||||
typedef wait_queue_entry_t spl_wait_queue_entry_t;
|
||||
#else
|
||||
typedef wait_queue_head_t spl_wait_queue_head_t;
|
||||
typedef wait_queue_t spl_wait_queue_entry_t;
|
||||
#endif
|
||||
],[
|
||||
spl_wait_queue_head_t wq_head;
|
||||
spl_wait_queue_entry_t wq_entry;
|
||||
struct list_head *head __attribute__ ((unused));
|
||||
struct list_head *entry __attribute__ ((unused));
|
||||
|
||||
head = &wq_head.head;
|
||||
entry = &wq_entry.entry;
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_WAIT_QUEUE_HEAD_ENTRY], [
|
||||
AC_MSG_CHECKING([whether wq_head->head and wq_entry->entry exist])
|
||||
ZFS_LINUX_TEST_RESULT([wait_queue_head_entry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_WAIT_QUEUE_HEAD_ENTRY, 1,
|
||||
[wq_head->head and wq_entry->entry exist])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_WAIT], [
|
||||
ZFS_AC_KERNEL_SRC_WAIT_ON_BIT
|
||||
ZFS_AC_KERNEL_SRC_WAIT_QUEUE_HEAD_ENTRY
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_WAIT], [
|
||||
ZFS_AC_KERNEL_WAIT_ON_BIT
|
||||
ZFS_AC_KERNEL_WAIT_QUEUE_HEAD_ENTRY
|
||||
])
|
|
@ -34,73 +34,11 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER], [
|
|||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.5 API change,
|
||||
dnl # struct xattr_handler added new member "name".
|
||||
dnl # xattr_handler which matches to whole name rather than prefix should use
|
||||
dnl # "name" instead of "prefix", e.g. "system.posix_acl_access"
|
||||
dnl # Android API change,
|
||||
dnl # The xattr_handler->get() callback was
|
||||
dnl # changed to take dentry, inode and flags.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_NAME], [
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_name], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.name = XATTR_NAME_POSIX_ACL_ACCESS,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_NAME], [
|
||||
AC_MSG_CHECKING([whether xattr_handler has name])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_name], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_HANDLER_NAME, 1,
|
||||
[xattr_handler has name])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Supported xattr handler get() interfaces checked newest to oldest.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET], [
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry_inode], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int get(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, struct inode *inode,
|
||||
const char *name, void *buffer, size_t size) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.get = get,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_get_xattr_handler], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int get(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
void *buffer, size_t size) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.get = get,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int get(struct dentry *dentry, const char *name,
|
||||
void *buffer, size_t size, int handler_flags)
|
||||
{ return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.get = get,
|
||||
};
|
||||
],[])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_get_dentry_inode_flags], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
|
@ -115,63 +53,16 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET], [
|
|||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [
|
||||
dnl #
|
||||
dnl # 4.7 API change,
|
||||
dnl # The xattr_handler->get() callback was changed to take both
|
||||
dnl # dentry and inode.
|
||||
dnl #
|
||||
AC_MSG_CHECKING([whether xattr_handler->get() wants dentry and inode])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode], [
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->get() wants dentry and inode and flags])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE, 1,
|
||||
[xattr_handler->get() wants both dentry and inode])
|
||||
AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE_FLAGS, 1,
|
||||
[xattr_handler->get() wants dentry and inode and flags])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.4 API change,
|
||||
dnl # The xattr_handler->get() callback was changed to take a
|
||||
dnl # attr_handler, and handler_flags argument was removed and
|
||||
dnl # should be accessed by handler->flags.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->get() wants xattr_handler])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_xattr_handler], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_GET_HANDLER, 1,
|
||||
[xattr_handler->get() wants xattr_handler])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 2.6.33 API change,
|
||||
dnl # The xattr_handler->get() callback was changed
|
||||
dnl # to take a dentry instead of an inode, and a
|
||||
dnl # handler_flags argument was added.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->get() wants dentry])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_GET_DENTRY, 1,
|
||||
[xattr_handler->get() wants dentry])
|
||||
],[
|
||||
dnl #
|
||||
dnl # Android API change,
|
||||
dnl # The xattr_handler->get() callback was
|
||||
dnl # changed to take dentry, inode and flags.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->get() wants dentry and inode and flags])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_get_dentry_inode_flags], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_GET_DENTRY_INODE_FLAGS, 1,
|
||||
[xattr_handler->get() wants dentry and inode and flags])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([xattr get()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
|
@ -222,31 +113,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [
|
|||
.set = set,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_set_xattr_handler], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int set(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags)
|
||||
{ return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.set = set,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_set_dentry], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static int set(struct dentry *dentry, const char *name,
|
||||
const void *buffer, size_t size, int flags,
|
||||
int handler_flags) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.set = set,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
||||
|
@ -264,6 +130,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
|||
AC_DEFINE(HAVE_XATTR_SET_IDMAP, 1,
|
||||
[xattr_handler->set() takes mnt_idmap])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING([whether xattr_handler->set() wants dentry, inode, and user_namespace])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
|
@ -282,152 +149,12 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [
|
|||
AC_DEFINE(HAVE_XATTR_SET_DENTRY_INODE, 1,
|
||||
[xattr_handler->set() wants both dentry and inode])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.4 API change,
|
||||
dnl # The xattr_handler->set() callback was changed to take a
|
||||
dnl # xattr_handler, and handler_flags argument was removed and
|
||||
dnl # should be accessed by handler->flags.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->set() wants xattr_handler])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_xattr_handler], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_SET_HANDLER, 1,
|
||||
[xattr_handler->set() wants xattr_handler])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 2.6.33 API change,
|
||||
dnl # The xattr_handler->set() callback was changed
|
||||
dnl # to take a dentry instead of an inode, and a
|
||||
dnl # handler_flags argument was added.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->set() wants dentry])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_set_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1,
|
||||
[xattr_handler->set() wants dentry])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([xattr set()])
|
||||
])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([xattr set()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # Supported xattr handler list() interfaces checked newest to oldest.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST], [
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_list_simple], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static bool list(struct dentry *dentry) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.list = list,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_list_xattr_handler], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static size_t list(const struct xattr_handler *handler,
|
||||
struct dentry *dentry, char *list, size_t list_size,
|
||||
const char *name, size_t name_len) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.list = list,
|
||||
};
|
||||
],[])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([xattr_handler_list_dentry], [
|
||||
#include <linux/xattr.h>
|
||||
|
||||
static size_t list(struct dentry *dentry,
|
||||
char *list, size_t list_size,
|
||||
const char *name, size_t name_len,
|
||||
int handler_flags) { return 0; }
|
||||
static const struct xattr_handler
|
||||
xops __attribute__ ((unused)) = {
|
||||
.list = list,
|
||||
};
|
||||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [
|
||||
dnl # 4.5 API change,
|
||||
dnl # The xattr_handler->list() callback was changed to take only a
|
||||
dnl # dentry and it only needs to return if it's accessible.
|
||||
AC_MSG_CHECKING([whether xattr_handler->list() wants simple])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_list_simple], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_LIST_SIMPLE, 1,
|
||||
[xattr_handler->list() wants simple])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 4.4 API change,
|
||||
dnl # The xattr_handler->list() callback was changed to take a
|
||||
dnl # xattr_handler, and handler_flags argument was removed
|
||||
dnl # and should be accessed by handler->flags.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->list() wants xattr_handler])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_list_xattr_handler], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_LIST_HANDLER, 1,
|
||||
[xattr_handler->list() wants xattr_handler])
|
||||
],[
|
||||
dnl #
|
||||
dnl # 2.6.33 API change,
|
||||
dnl # The xattr_handler->list() callback was changed
|
||||
dnl # to take a dentry instead of an inode, and a
|
||||
dnl # handler_flags argument was added.
|
||||
dnl #
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(
|
||||
[whether xattr_handler->list() wants dentry])
|
||||
ZFS_LINUX_TEST_RESULT([xattr_handler_list_dentry], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_XATTR_LIST_DENTRY, 1,
|
||||
[xattr_handler->list() wants dentry])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([xattr list()])
|
||||
])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 3.7 API change,
|
||||
dnl # The posix_acl_{from,to}_xattr functions gained a new
|
||||
dnl # parameter: user_ns
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_FROM_XATTR_USERNS], [
|
||||
ZFS_LINUX_TEST_SRC([posix_acl_from_xattr_userns], [
|
||||
#include <linux/cred.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/posix_acl_xattr.h>
|
||||
],[
|
||||
posix_acl_from_xattr(&init_user_ns, NULL, 0);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS], [
|
||||
AC_MSG_CHECKING([whether posix_acl_from_xattr() needs user_ns])
|
||||
ZFS_LINUX_TEST_RESULT([posix_acl_from_xattr_userns], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_POSIX_ACL_FROM_XATTR_USERNS, 1,
|
||||
[posix_acl_from_xattr() needs user_ns])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([posix_acl_from_xattr()])
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 4.9 API change,
|
||||
dnl # iops->{set,get,remove}xattr and generic_{set,get,remove}xattr are
|
||||
|
@ -445,33 +172,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_SETXATTR], [
|
|||
],[])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_SETXATTR], [
|
||||
AC_MSG_CHECKING([whether generic_setxattr() exists])
|
||||
ZFS_LINUX_TEST_RESULT([have_generic_setxattr], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_GENERIC_SETXATTR, 1,
|
||||
[generic_setxattr() exists])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR], [
|
||||
ZFS_AC_KERNEL_SRC_CONST_XATTR_HANDLER
|
||||
ZFS_AC_KERNEL_SRC_XATTR_HANDLER_NAME
|
||||
ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET
|
||||
ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS
|
||||
ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET
|
||||
ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST
|
||||
ZFS_AC_KERNEL_SRC_POSIX_ACL_FROM_XATTR_USERNS
|
||||
ZFS_AC_KERNEL_SRC_GENERIC_SETXATTR
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_XATTR], [
|
||||
ZFS_AC_KERNEL_CONST_XATTR_HANDLER
|
||||
ZFS_AC_KERNEL_XATTR_HANDLER_NAME
|
||||
ZFS_AC_KERNEL_XATTR_HANDLER_GET
|
||||
ZFS_AC_KERNEL_XATTR_HANDLER_GET_DENTRY_INODE_FLAGS
|
||||
ZFS_AC_KERNEL_XATTR_HANDLER_SET
|
||||
ZFS_AC_KERNEL_XATTR_HANDLER_LIST
|
||||
ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS
|
||||
ZFS_AC_KERNEL_GENERIC_SETXATTR
|
||||
])
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
dnl #
|
||||
dnl # 2.6.39 API compat,
|
||||
dnl
|
||||
dnl # The function zlib_deflate_workspacesize() now take 2 arguments.
|
||||
dnl # This was done to avoid always having to allocate the maximum size
|
||||
dnl # workspace (268K). The caller can now specific the windowBits and
|
||||
dnl # memLevel compression parameters to get a smaller workspace.
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE], [
|
||||
ZFS_LINUX_TEST_SRC([2args_zlib_deflate_workspacesize], [
|
||||
#include <linux/zlib.h>
|
||||
],[
|
||||
return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE], [
|
||||
AC_MSG_CHECKING([whether zlib_deflate_workspacesize() wants 2 args])
|
||||
ZFS_LINUX_TEST_RESULT([2args_zlib_deflate_workspacesize], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE, 1,
|
||||
[zlib_deflate_workspacesize() wants 2 args])
|
||||
],[
|
||||
ZFS_LINUX_TEST_ERROR([zlib_deflate_workspacesize()])
|
||||
])
|
||||
])
|
|
@ -14,7 +14,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||
dnl # Sequential ZFS_LINUX_TRY_COMPILE tests
|
||||
ZFS_AC_KERNEL_FPU_HEADER
|
||||
ZFS_AC_KERNEL_OBJTOOL_HEADER
|
||||
ZFS_AC_KERNEL_WAIT_QUEUE_ENTRY_T
|
||||
ZFS_AC_KERNEL_MISC_MINOR
|
||||
ZFS_AC_KERNEL_DECLARE_EVENT_CLASS
|
||||
|
||||
|
@ -39,26 +38,13 @@ dnl #
|
|||
AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
||||
ZFS_AC_KERNEL_SRC_TYPES
|
||||
ZFS_AC_KERNEL_SRC_OBJTOOL
|
||||
ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE
|
||||
ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE
|
||||
ZFS_AC_KERNEL_SRC_PDE_DATA
|
||||
ZFS_AC_KERNEL_SRC_FALLOCATE
|
||||
ZFS_AC_KERNEL_SRC_FADVISE
|
||||
ZFS_AC_KERNEL_SRC_GENERIC_FADVISE
|
||||
ZFS_AC_KERNEL_SRC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
|
||||
ZFS_AC_KERNEL_SRC_RWSEM
|
||||
ZFS_AC_KERNEL_SRC_SCHED
|
||||
ZFS_AC_KERNEL_SRC_USLEEP_RANGE
|
||||
ZFS_AC_KERNEL_SRC_KMEM_CACHE
|
||||
ZFS_AC_KERNEL_SRC_KVMALLOC
|
||||
ZFS_AC_KERNEL_SRC_VMALLOC_PAGE_KERNEL
|
||||
ZFS_AC_KERNEL_SRC_WAIT
|
||||
ZFS_AC_KERNEL_SRC_INODE_TIMES
|
||||
ZFS_AC_KERNEL_SRC_INODE_LOCK
|
||||
ZFS_AC_KERNEL_SRC_GROUP_INFO_GID
|
||||
ZFS_AC_KERNEL_SRC_RW
|
||||
ZFS_AC_KERNEL_SRC_TIMER_SETUP
|
||||
ZFS_AC_KERNEL_SRC_SUPER_USER_NS
|
||||
ZFS_AC_KERNEL_SRC_PROC_OPERATIONS
|
||||
ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS
|
||||
ZFS_AC_KERNEL_SRC_BIO
|
||||
|
@ -67,63 +53,39 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||
ZFS_AC_KERNEL_SRC_GENHD_FLAGS
|
||||
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK
|
||||
ZFS_AC_KERNEL_SRC_GET_DISK_RO
|
||||
ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL
|
||||
ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY
|
||||
ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE
|
||||
ZFS_AC_KERNEL_SRC_XATTR
|
||||
ZFS_AC_KERNEL_SRC_ACL
|
||||
ZFS_AC_KERNEL_SRC_INODE_SETATTR
|
||||
ZFS_AC_KERNEL_SRC_INODE_GETATTR
|
||||
ZFS_AC_KERNEL_SRC_INODE_SET_FLAGS
|
||||
ZFS_AC_KERNEL_SRC_INODE_SET_IVERSION
|
||||
ZFS_AC_KERNEL_SRC_SHOW_OPTIONS
|
||||
ZFS_AC_KERNEL_SRC_FILE_INODE
|
||||
ZFS_AC_KERNEL_SRC_FILE_DENTRY
|
||||
ZFS_AC_KERNEL_SRC_FSYNC
|
||||
ZFS_AC_KERNEL_SRC_AIO_FSYNC
|
||||
ZFS_AC_KERNEL_SRC_EVICT_INODE
|
||||
ZFS_AC_KERNEL_SRC_DIRTY_INODE
|
||||
ZFS_AC_KERNEL_SRC_SHRINKER
|
||||
ZFS_AC_KERNEL_SRC_MKDIR
|
||||
ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS
|
||||
ZFS_AC_KERNEL_SRC_CREATE
|
||||
ZFS_AC_KERNEL_SRC_PERMISSION
|
||||
ZFS_AC_KERNEL_SRC_GET_LINK
|
||||
ZFS_AC_KERNEL_SRC_PUT_LINK
|
||||
ZFS_AC_KERNEL_SRC_TMPFILE
|
||||
ZFS_AC_KERNEL_SRC_AUTOMOUNT
|
||||
ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE
|
||||
ZFS_AC_KERNEL_SRC_COMMIT_METADATA
|
||||
ZFS_AC_KERNEL_SRC_CLEAR_INODE
|
||||
ZFS_AC_KERNEL_SRC_SETATTR_PREPARE
|
||||
ZFS_AC_KERNEL_SRC_INSERT_INODE_LOCKED
|
||||
ZFS_AC_KERNEL_SRC_DENTRY
|
||||
ZFS_AC_KERNEL_SRC_DENTRY_ALIAS_D_U
|
||||
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
|
||||
ZFS_AC_KERNEL_SRC_SECURITY_INODE
|
||||
ZFS_AC_KERNEL_SRC_FST_MOUNT
|
||||
ZFS_AC_KERNEL_SRC_BDI
|
||||
ZFS_AC_KERNEL_SRC_SET_NLINK
|
||||
ZFS_AC_KERNEL_SRC_SGET
|
||||
ZFS_AC_KERNEL_SRC_LSEEK_EXECUTE
|
||||
ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO
|
||||
ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO
|
||||
ZFS_AC_KERNEL_SRC_VFS_GETATTR
|
||||
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
|
||||
ZFS_AC_KERNEL_SRC_VFS_ITERATE
|
||||
ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
|
||||
ZFS_AC_KERNEL_SRC_VFS_READPAGES
|
||||
ZFS_AC_KERNEL_SRC_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||
ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
|
||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
|
||||
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||
ZFS_AC_KERNEL_SRC_VFS_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_SPLICE_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_REMAP_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_CLONE_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_DEDUPE_FILE_RANGE
|
||||
ZFS_AC_KERNEL_SRC_VFS_FILE_OPERATIONS_EXTEND
|
||||
ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS
|
||||
ZFS_AC_KERNEL_SRC_KMAP_LOCAL_PAGE
|
||||
ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE
|
||||
|
@ -134,36 +96,25 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||
ZFS_AC_KERNEL_SRC_KUIDGID_T
|
||||
ZFS_AC_KERNEL_SRC_KUID_HELPERS
|
||||
ZFS_AC_KERNEL_SRC_RENAME
|
||||
ZFS_AC_KERNEL_SRC_CURRENT_TIME
|
||||
ZFS_AC_KERNEL_SRC_USERNS_CAPABILITIES
|
||||
ZFS_AC_KERNEL_SRC_IN_COMPAT_SYSCALL
|
||||
ZFS_AC_KERNEL_SRC_KTIME
|
||||
ZFS_AC_KERNEL_SRC_TOTALRAM_PAGES_FUNC
|
||||
ZFS_AC_KERNEL_SRC_TOTALHIGH_PAGES
|
||||
ZFS_AC_KERNEL_SRC_KSTRTOUL
|
||||
ZFS_AC_KERNEL_SRC_PERCPU
|
||||
ZFS_AC_KERNEL_SRC_CPU_HOTPLUG
|
||||
ZFS_AC_KERNEL_SRC_GENERIC_FILLATTR
|
||||
ZFS_AC_KERNEL_SRC_MKNOD
|
||||
ZFS_AC_KERNEL_SRC_SYMLINK
|
||||
ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS
|
||||
ZFS_AC_KERNEL_SRC_SIGNAL_STOP
|
||||
ZFS_AC_KERNEL_SRC_SIGINFO
|
||||
ZFS_AC_KERNEL_SRC_SYSFS
|
||||
ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE
|
||||
ZFS_AC_KERNEL_SRC_STANDALONE_LINUX_STDARG
|
||||
ZFS_AC_KERNEL_SRC_STRLCPY
|
||||
ZFS_AC_KERNEL_SRC_STRSCPY
|
||||
ZFS_AC_KERNEL_SRC_PAGEMAP_FOLIO_WAIT_BIT
|
||||
ZFS_AC_KERNEL_SRC_ADD_DISK
|
||||
ZFS_AC_KERNEL_SRC_KTHREAD
|
||||
ZFS_AC_KERNEL_SRC_ZERO_PAGE
|
||||
ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC
|
||||
ZFS_AC_KERNEL_SRC_USER_NS_COMMON_INUM
|
||||
ZFS_AC_KERNEL_SRC_IDMAP_MNT_API
|
||||
ZFS_AC_KERNEL_SRC_IDMAP_NO_USERNS
|
||||
ZFS_AC_KERNEL_SRC_IATTR_VFSID
|
||||
ZFS_AC_KERNEL_SRC_FILEMAP
|
||||
ZFS_AC_KERNEL_SRC_WRITEPAGE_T
|
||||
ZFS_AC_KERNEL_SRC_RECLAIMED
|
||||
ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE
|
||||
|
@ -194,26 +145,13 @@ dnl #
|
|||
AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
||||
ZFS_AC_KERNEL_TYPES
|
||||
ZFS_AC_KERNEL_ACCESS_OK_TYPE
|
||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE
|
||||
ZFS_AC_KERNEL_OBJTOOL
|
||||
ZFS_AC_KERNEL_PDE_DATA
|
||||
ZFS_AC_KERNEL_FALLOCATE
|
||||
ZFS_AC_KERNEL_FADVISE
|
||||
ZFS_AC_KERNEL_GENERIC_FADVISE
|
||||
ZFS_AC_KERNEL_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
|
||||
ZFS_AC_KERNEL_RWSEM
|
||||
ZFS_AC_KERNEL_SCHED
|
||||
ZFS_AC_KERNEL_USLEEP_RANGE
|
||||
ZFS_AC_KERNEL_KMEM_CACHE
|
||||
ZFS_AC_KERNEL_KVMALLOC
|
||||
ZFS_AC_KERNEL_VMALLOC_PAGE_KERNEL
|
||||
ZFS_AC_KERNEL_WAIT
|
||||
ZFS_AC_KERNEL_INODE_TIMES
|
||||
ZFS_AC_KERNEL_INODE_LOCK
|
||||
ZFS_AC_KERNEL_GROUP_INFO_GID
|
||||
ZFS_AC_KERNEL_RW
|
||||
ZFS_AC_KERNEL_TIMER_SETUP
|
||||
ZFS_AC_KERNEL_SUPER_USER_NS
|
||||
ZFS_AC_KERNEL_PROC_OPERATIONS
|
||||
ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS
|
||||
ZFS_AC_KERNEL_BIO
|
||||
|
@ -222,63 +160,39 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||
ZFS_AC_KERNEL_GENHD_FLAGS
|
||||
ZFS_AC_KERNEL_REVALIDATE_DISK
|
||||
ZFS_AC_KERNEL_GET_DISK_RO
|
||||
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
||||
ZFS_AC_KERNEL_DISCARD_GRANULARITY
|
||||
ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE
|
||||
ZFS_AC_KERNEL_XATTR
|
||||
ZFS_AC_KERNEL_ACL
|
||||
ZFS_AC_KERNEL_INODE_SETATTR
|
||||
ZFS_AC_KERNEL_INODE_GETATTR
|
||||
ZFS_AC_KERNEL_INODE_SET_FLAGS
|
||||
ZFS_AC_KERNEL_INODE_SET_IVERSION
|
||||
ZFS_AC_KERNEL_SHOW_OPTIONS
|
||||
ZFS_AC_KERNEL_FILE_INODE
|
||||
ZFS_AC_KERNEL_FILE_DENTRY
|
||||
ZFS_AC_KERNEL_FSYNC
|
||||
ZFS_AC_KERNEL_AIO_FSYNC
|
||||
ZFS_AC_KERNEL_EVICT_INODE
|
||||
ZFS_AC_KERNEL_DIRTY_INODE
|
||||
ZFS_AC_KERNEL_SHRINKER
|
||||
ZFS_AC_KERNEL_MKDIR
|
||||
ZFS_AC_KERNEL_LOOKUP_FLAGS
|
||||
ZFS_AC_KERNEL_CREATE
|
||||
ZFS_AC_KERNEL_PERMISSION
|
||||
ZFS_AC_KERNEL_GET_LINK
|
||||
ZFS_AC_KERNEL_PUT_LINK
|
||||
ZFS_AC_KERNEL_TMPFILE
|
||||
ZFS_AC_KERNEL_AUTOMOUNT
|
||||
ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
|
||||
ZFS_AC_KERNEL_COMMIT_METADATA
|
||||
ZFS_AC_KERNEL_CLEAR_INODE
|
||||
ZFS_AC_KERNEL_SETATTR_PREPARE
|
||||
ZFS_AC_KERNEL_INSERT_INODE_LOCKED
|
||||
ZFS_AC_KERNEL_DENTRY
|
||||
ZFS_AC_KERNEL_DENTRY_ALIAS_D_U
|
||||
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
|
||||
ZFS_AC_KERNEL_SECURITY_INODE
|
||||
ZFS_AC_KERNEL_FST_MOUNT
|
||||
ZFS_AC_KERNEL_BDI
|
||||
ZFS_AC_KERNEL_SET_NLINK
|
||||
ZFS_AC_KERNEL_SGET
|
||||
ZFS_AC_KERNEL_LSEEK_EXECUTE
|
||||
ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO
|
||||
ZFS_AC_KERNEL_VFS_READ_FOLIO
|
||||
ZFS_AC_KERNEL_VFS_GETATTR
|
||||
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
|
||||
ZFS_AC_KERNEL_VFS_ITERATE
|
||||
ZFS_AC_KERNEL_VFS_DIRECT_IO
|
||||
ZFS_AC_KERNEL_VFS_READPAGES
|
||||
ZFS_AC_KERNEL_VFS_SET_PAGE_DIRTY_NOBUFFERS
|
||||
ZFS_AC_KERNEL_VFS_RW_ITERATE
|
||||
ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
|
||||
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||
ZFS_AC_KERNEL_VFS_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_GENERIC_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_SPLICE_COPY_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_REMAP_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_CLONE_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_DEDUPE_FILE_RANGE
|
||||
ZFS_AC_KERNEL_VFS_FILE_OPERATIONS_EXTEND
|
||||
ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS
|
||||
ZFS_AC_KERNEL_KMAP_LOCAL_PAGE
|
||||
ZFS_AC_KERNEL_FOLLOW_DOWN_ONE
|
||||
|
@ -289,36 +203,25 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||
ZFS_AC_KERNEL_KUIDGID_T
|
||||
ZFS_AC_KERNEL_KUID_HELPERS
|
||||
ZFS_AC_KERNEL_RENAME
|
||||
ZFS_AC_KERNEL_CURRENT_TIME
|
||||
ZFS_AC_KERNEL_USERNS_CAPABILITIES
|
||||
ZFS_AC_KERNEL_IN_COMPAT_SYSCALL
|
||||
ZFS_AC_KERNEL_KTIME
|
||||
ZFS_AC_KERNEL_TOTALRAM_PAGES_FUNC
|
||||
ZFS_AC_KERNEL_TOTALHIGH_PAGES
|
||||
ZFS_AC_KERNEL_KSTRTOUL
|
||||
ZFS_AC_KERNEL_PERCPU
|
||||
ZFS_AC_KERNEL_CPU_HOTPLUG
|
||||
ZFS_AC_KERNEL_GENERIC_FILLATTR
|
||||
ZFS_AC_KERNEL_MKNOD
|
||||
ZFS_AC_KERNEL_SYMLINK
|
||||
ZFS_AC_KERNEL_BIO_MAX_SEGS
|
||||
ZFS_AC_KERNEL_SIGNAL_STOP
|
||||
ZFS_AC_KERNEL_SIGINFO
|
||||
ZFS_AC_KERNEL_SYSFS
|
||||
ZFS_AC_KERNEL_SET_SPECIAL_STATE
|
||||
ZFS_AC_KERNEL_STANDALONE_LINUX_STDARG
|
||||
ZFS_AC_KERNEL_STRLCPY
|
||||
ZFS_AC_KERNEL_STRSCPY
|
||||
ZFS_AC_KERNEL_PAGEMAP_FOLIO_WAIT_BIT
|
||||
ZFS_AC_KERNEL_ADD_DISK
|
||||
ZFS_AC_KERNEL_KTHREAD
|
||||
ZFS_AC_KERNEL_ZERO_PAGE
|
||||
ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC
|
||||
ZFS_AC_KERNEL_USER_NS_COMMON_INUM
|
||||
ZFS_AC_KERNEL_IDMAP_MNT_API
|
||||
ZFS_AC_KERNEL_IDMAP_NO_USERNS
|
||||
ZFS_AC_KERNEL_IATTR_VFSID
|
||||
ZFS_AC_KERNEL_FILEMAP
|
||||
ZFS_AC_KERNEL_WRITEPAGE_T
|
||||
ZFS_AC_KERNEL_RECLAIMED
|
||||
ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
usr/bin/arc_summary.py
|
||||
usr/share/zfs/enum-extract.pl
|
||||
usr/share/zfs/zfs-helpers.sh
|
||||
etc/default/zfs
|
||||
etc/init.d
|
||||
|
|
|
@ -86,7 +86,6 @@ override_dh_auto_install:
|
|||
@# Install the DKMS source.
|
||||
@# We only want the files needed to build the modules
|
||||
install -D -t '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts' \
|
||||
'$(CURDIR)/scripts/enum-extract.pl' \
|
||||
'$(CURDIR)/scripts/dkms.postbuild'
|
||||
$(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ kernel_linux_HEADERS = \
|
|||
%D%/kernel/linux/mm_compat.h \
|
||||
%D%/kernel/linux/mod_compat.h \
|
||||
%D%/kernel/linux/page_compat.h \
|
||||
%D%/kernel/linux/percpu_compat.h \
|
||||
%D%/kernel/linux/simd.h \
|
||||
%D%/kernel/linux/simd_aarch64.h \
|
||||
%D%/kernel/linux/simd_arm.h \
|
||||
|
|
|
@ -35,50 +35,19 @@
|
|||
#include <linux/major.h>
|
||||
#include <linux/msdos_fs.h> /* for SECTOR_* */
|
||||
#include <linux/bio.h>
|
||||
|
||||
#ifdef HAVE_BLK_MQ
|
||||
#include <linux/blk-mq.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BLK_QUEUE_FLAG_SET
|
||||
static inline void
|
||||
blk_queue_flag_set(unsigned int flag, struct request_queue *q)
|
||||
{
|
||||
queue_flag_set(flag, q);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_BLK_QUEUE_FLAG_CLEAR
|
||||
static inline void
|
||||
blk_queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
{
|
||||
queue_flag_clear(flag, q);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 6.11 API
|
||||
* Setting the flush flags directly is no longer possible; flush flags are set
|
||||
* on the queue_limits structure and passed to blk_disk_alloc(). In this case
|
||||
* we remove this function entirely.
|
||||
*
|
||||
* 4.7 API,
|
||||
* The blk_queue_write_cache() interface has replaced blk_queue_flush()
|
||||
* interface. However, the new interface is GPL-only thus we implement
|
||||
* our own trivial wrapper when the GPL-only version is detected.
|
||||
*
|
||||
* 2.6.36 - 4.6 API,
|
||||
* The blk_queue_flush() interface has replaced blk_queue_ordered()
|
||||
* interface. However, while the old interface was available to all the
|
||||
* new one is GPL-only. Thus if the GPL-only version is detected we
|
||||
* implement our own trivial helper.
|
||||
*/
|
||||
#if !defined(HAVE_BLK_ALLOC_DISK_2ARG) || \
|
||||
!defined(HAVE_BLKDEV_QUEUE_LIMITS_FEATURES)
|
||||
static inline void
|
||||
blk_queue_set_write_cache(struct request_queue *q, bool on)
|
||||
{
|
||||
#if defined(HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY)
|
||||
if (on) {
|
||||
blk_queue_flag_set(QUEUE_FLAG_WC, q);
|
||||
blk_queue_flag_set(QUEUE_FLAG_FUA, q);
|
||||
|
@ -86,18 +55,6 @@ blk_queue_set_write_cache(struct request_queue *q, bool on)
|
|||
blk_queue_flag_clear(QUEUE_FLAG_WC, q);
|
||||
blk_queue_flag_clear(QUEUE_FLAG_FUA, q);
|
||||
}
|
||||
#elif defined(HAVE_BLK_QUEUE_WRITE_CACHE)
|
||||
blk_queue_write_cache(q, on, on);
|
||||
#elif defined(HAVE_BLK_QUEUE_FLUSH_GPL_ONLY)
|
||||
if (on)
|
||||
q->flush_flags |= REQ_FLUSH | REQ_FUA;
|
||||
else
|
||||
q->flush_flags &= ~(REQ_FLUSH | REQ_FUA);
|
||||
#elif defined(HAVE_BLK_QUEUE_FLUSH)
|
||||
blk_queue_flush(q, on ? (REQ_FLUSH | REQ_FUA) : 0);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
}
|
||||
#endif /* !HAVE_BLK_ALLOC_DISK_2ARG || !HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */
|
||||
|
||||
|
@ -143,7 +100,6 @@ blk_queue_set_read_ahead(struct request_queue *q, unsigned long ra_pages)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_BIO_BVEC_ITER
|
||||
#define BIO_BI_SECTOR(bio) (bio)->bi_iter.bi_sector
|
||||
#define BIO_BI_SIZE(bio) (bio)->bi_iter.bi_size
|
||||
#define BIO_BI_IDX(bio) (bio)->bi_iter.bi_idx
|
||||
|
@ -151,15 +107,6 @@ blk_queue_set_read_ahead(struct request_queue *q, unsigned long ra_pages)
|
|||
#define bio_for_each_segment4(bv, bvp, b, i) \
|
||||
bio_for_each_segment((bv), (b), (i))
|
||||
typedef struct bvec_iter bvec_iterator_t;
|
||||
#else
|
||||
#define BIO_BI_SECTOR(bio) (bio)->bi_sector
|
||||
#define BIO_BI_SIZE(bio) (bio)->bi_size
|
||||
#define BIO_BI_IDX(bio) (bio)->bi_idx
|
||||
#define BIO_BI_SKIP(bio) (0)
|
||||
#define bio_for_each_segment4(bv, bvp, b, i) \
|
||||
bio_for_each_segment((bvp), (b), (i))
|
||||
typedef int bvec_iterator_t;
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
bio_set_flags_failfast(struct block_device *bdev, int *flags, bool dev,
|
||||
|
@ -200,7 +147,6 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags, bool dev,
|
|||
#define DISK_NAME_LEN 32
|
||||
#endif /* DISK_NAME_LEN */
|
||||
|
||||
#ifdef HAVE_BIO_BI_STATUS
|
||||
static inline int
|
||||
bi_status_to_errno(blk_status_t status)
|
||||
{
|
||||
|
@ -274,42 +220,6 @@ errno_to_bi_status(int error)
|
|||
return (BLK_STS_IOERR);
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_BIO_BI_STATUS */
|
||||
|
||||
/*
|
||||
* 4.3 API change
|
||||
* The bio_endio() prototype changed slightly. These are helper
|
||||
* macro's to ensure the prototype and invocation are handled.
|
||||
*/
|
||||
#ifdef HAVE_1ARG_BIO_END_IO_T
|
||||
#ifdef HAVE_BIO_BI_STATUS
|
||||
#define BIO_END_IO_ERROR(bio) bi_status_to_errno(bio->bi_status)
|
||||
#define BIO_END_IO_PROTO(fn, x, z) static void fn(struct bio *x)
|
||||
#define BIO_END_IO(bio, error) bio_set_bi_status(bio, error)
|
||||
static inline void
|
||||
bio_set_bi_status(struct bio *bio, int error)
|
||||
{
|
||||
ASSERT3S(error, <=, 0);
|
||||
bio->bi_status = errno_to_bi_status(-error);
|
||||
bio_endio(bio);
|
||||
}
|
||||
#else
|
||||
#define BIO_END_IO_ERROR(bio) (-(bio->bi_error))
|
||||
#define BIO_END_IO_PROTO(fn, x, z) static void fn(struct bio *x)
|
||||
#define BIO_END_IO(bio, error) bio_set_bi_error(bio, error)
|
||||
static inline void
|
||||
bio_set_bi_error(struct bio *bio, int error)
|
||||
{
|
||||
ASSERT3S(error, <=, 0);
|
||||
bio->bi_error = error;
|
||||
bio_endio(bio);
|
||||
}
|
||||
#endif /* HAVE_BIO_BI_STATUS */
|
||||
|
||||
#else
|
||||
#define BIO_END_IO_PROTO(fn, x, z) static void fn(struct bio *x, int z)
|
||||
#define BIO_END_IO(bio, error) bio_endio(bio, error);
|
||||
#endif /* HAVE_1ARG_BIO_END_IO_T */
|
||||
|
||||
/*
|
||||
* 5.15 MACRO,
|
||||
|
@ -337,6 +247,19 @@ zfs_check_disk_status(struct block_device *bdev)
|
|||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 5.17 API change
|
||||
*
|
||||
* GENHD_FL_EXT_DEVT flag removed
|
||||
* GENHD_FL_NO_PART_SCAN renamed GENHD_FL_NO_PART
|
||||
*/
|
||||
#ifndef HAVE_GENHD_FL_EXT_DEVT
|
||||
#define GENHD_FL_EXT_DEVT (0)
|
||||
#endif
|
||||
#ifndef HAVE_GENHD_FL_NO_PART
|
||||
#define GENHD_FL_NO_PART (GENHD_FL_NO_PART_SCAN)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.1 API,
|
||||
* 3.10.0 CentOS 7.x API,
|
||||
|
@ -399,9 +322,6 @@ zfs_check_media_change(struct block_device *bdev)
|
|||
* The function was exported for use, prior to this it existed but the
|
||||
* symbol was not exported.
|
||||
*
|
||||
* 4.4.0-6.21 API change for Ubuntu
|
||||
* lookup_bdev() gained a second argument, FMODE_*, to check inode permissions.
|
||||
*
|
||||
* 5.11 API change
|
||||
* Changed to take a dev_t argument which is set on success and return a
|
||||
* non-zero error code on failure.
|
||||
|
@ -419,15 +339,6 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
|||
*dev = bdev->bd_dev;
|
||||
bdput(bdev);
|
||||
|
||||
return (0);
|
||||
#elif defined(HAVE_MODE_LOOKUP_BDEV)
|
||||
struct block_device *bdev = lookup_bdev(path, FMODE_READ);
|
||||
if (IS_ERR(bdev))
|
||||
return (PTR_ERR(bdev));
|
||||
|
||||
*dev = bdev->bd_dev;
|
||||
bdput(bdev);
|
||||
|
||||
return (0);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
|
@ -447,56 +358,24 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
|||
static inline void
|
||||
bio_set_op_attrs(struct bio *bio, unsigned rw, unsigned flags)
|
||||
{
|
||||
#if defined(HAVE_BIO_BI_OPF)
|
||||
bio->bi_opf = rw | flags;
|
||||
#else
|
||||
bio->bi_rw |= rw | flags;
|
||||
#endif /* HAVE_BIO_BI_OPF */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* bio_set_flush - Set the appropriate flags in a bio to guarantee
|
||||
* data are on non-volatile media on completion.
|
||||
*
|
||||
* 2.6.37 - 4.8 API,
|
||||
* Introduce WRITE_FLUSH, WRITE_FUA, and WRITE_FLUSH_FUA flags as a
|
||||
* replacement for WRITE_BARRIER to allow expressing richer semantics
|
||||
* to the block layer. It's up to the block layer to implement the
|
||||
* semantics correctly. Use the WRITE_FLUSH_FUA flag combination.
|
||||
*
|
||||
* 4.8 - 4.9 API,
|
||||
* REQ_FLUSH was renamed to REQ_PREFLUSH. For consistency with previous
|
||||
* OpenZFS releases, prefer the WRITE_FLUSH_FUA flag set if it's available.
|
||||
*
|
||||
* 4.10 API,
|
||||
* The read/write flags and their modifiers, including WRITE_FLUSH,
|
||||
* WRITE_FUA and WRITE_FLUSH_FUA were removed from fs.h in
|
||||
* torvalds/linux@70fd7614 and replaced by direct flag modification
|
||||
* of the REQ_ flags in bio->bi_opf. Use REQ_PREFLUSH.
|
||||
*/
|
||||
static inline void
|
||||
bio_set_flush(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_REQ_PREFLUSH) /* >= 4.10 */
|
||||
bio_set_op_attrs(bio, 0, REQ_PREFLUSH | REQ_OP_WRITE);
|
||||
#elif defined(WRITE_FLUSH_FUA) /* >= 2.6.37 and <= 4.9 */
|
||||
bio_set_op_attrs(bio, 0, WRITE_FLUSH_FUA);
|
||||
#else
|
||||
#error "Allowing the build will cause bio_set_flush requests to be ignored."
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 4.8 API,
|
||||
* REQ_OP_FLUSH
|
||||
*
|
||||
* 4.8-rc0 - 4.8-rc1,
|
||||
* REQ_PREFLUSH
|
||||
*
|
||||
* 2.6.36 - 4.7 API,
|
||||
* REQ_FLUSH
|
||||
*
|
||||
* in all cases but may have a performance impact for some kernels. It
|
||||
* has the advantage of minimizing kernel specific changes in the zvol code.
|
||||
*
|
||||
|
@ -504,77 +383,40 @@ bio_set_flush(struct bio *bio)
|
|||
static inline boolean_t
|
||||
bio_is_flush(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_REQ_OP_FLUSH) && defined(HAVE_BIO_BI_OPF)
|
||||
return ((bio_op(bio) == REQ_OP_FLUSH) || (bio->bi_opf & REQ_PREFLUSH));
|
||||
#elif defined(HAVE_REQ_PREFLUSH) && defined(HAVE_BIO_BI_OPF)
|
||||
return (bio->bi_opf & REQ_PREFLUSH);
|
||||
#elif defined(HAVE_REQ_PREFLUSH) && !defined(HAVE_BIO_BI_OPF)
|
||||
return (bio->bi_rw & REQ_PREFLUSH);
|
||||
#elif defined(HAVE_REQ_FLUSH)
|
||||
return (bio->bi_rw & REQ_FLUSH);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
return (bio_op(bio) == REQ_OP_FLUSH);
|
||||
}
|
||||
|
||||
/*
|
||||
* 4.8 API,
|
||||
* REQ_FUA flag moved to bio->bi_opf
|
||||
*
|
||||
* 2.6.x - 4.7 API,
|
||||
* REQ_FUA
|
||||
*/
|
||||
static inline boolean_t
|
||||
bio_is_fua(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_BIO_BI_OPF)
|
||||
return (bio->bi_opf & REQ_FUA);
|
||||
#elif defined(REQ_FUA)
|
||||
return (bio->bi_rw & REQ_FUA);
|
||||
#else
|
||||
#error "Allowing the build will cause fua requests to be ignored."
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 4.8 API,
|
||||
* REQ_OP_DISCARD
|
||||
*
|
||||
* 2.6.36 - 4.7 API,
|
||||
* REQ_DISCARD
|
||||
*
|
||||
* In all cases the normal I/O path is used for discards. The only
|
||||
* difference is how the kernel tags individual I/Os as discards.
|
||||
*/
|
||||
static inline boolean_t
|
||||
bio_is_discard(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_REQ_OP_DISCARD)
|
||||
return (bio_op(bio) == REQ_OP_DISCARD);
|
||||
#elif defined(HAVE_REQ_DISCARD)
|
||||
return (bio->bi_rw & REQ_DISCARD);
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 4.8 API,
|
||||
* REQ_OP_SECURE_ERASE
|
||||
*
|
||||
* 2.6.36 - 4.7 API,
|
||||
* REQ_SECURE
|
||||
*/
|
||||
static inline boolean_t
|
||||
bio_is_secure_erase(struct bio *bio)
|
||||
{
|
||||
#if defined(HAVE_REQ_OP_SECURE_ERASE)
|
||||
return (bio_op(bio) == REQ_OP_SECURE_ERASE);
|
||||
#elif defined(REQ_SECURE)
|
||||
return (bio->bi_rw & REQ_SECURE);
|
||||
#else
|
||||
return (0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -615,9 +457,6 @@ bdev_discard_supported(struct block_device *bdev)
|
|||
*
|
||||
* 4.8 API,
|
||||
* blk_queue_secure_erase()
|
||||
*
|
||||
* 2.6.36 - 4.7 API,
|
||||
* blk_queue_secdiscard()
|
||||
*/
|
||||
static inline boolean_t
|
||||
bdev_secure_discard_supported(struct block_device *bdev)
|
||||
|
@ -626,8 +465,6 @@ bdev_secure_discard_supported(struct block_device *bdev)
|
|||
return (!!bdev_max_secure_erase_sectors(bdev));
|
||||
#elif defined(HAVE_BLK_QUEUE_SECURE_ERASE)
|
||||
return (!!blk_queue_secure_erase(bdev_get_queue(bdev)));
|
||||
#elif defined(HAVE_BLK_QUEUE_SECDISCARD)
|
||||
return (!!blk_queue_secdiscard(bdev_get_queue(bdev)));
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
@ -657,10 +494,6 @@ blk_generic_start_io_acct(struct request_queue *q __attribute__((unused)),
|
|||
return (disk_start_io_acct(disk, bio_sectors(bio), bio_op(bio)));
|
||||
#elif defined(HAVE_BIO_IO_ACCT)
|
||||
return (bio_start_io_acct(bio));
|
||||
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
||||
unsigned long start_time = jiffies;
|
||||
generic_start_io_acct(rw, bio_sectors(bio), &disk->part0);
|
||||
return (start_time);
|
||||
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
|
||||
unsigned long start_time = jiffies;
|
||||
generic_start_io_acct(q, rw, bio_sectors(bio), &disk->part0);
|
||||
|
@ -685,8 +518,6 @@ blk_generic_end_io_acct(struct request_queue *q __attribute__((unused)),
|
|||
disk_end_io_acct(disk, bio_op(bio), start_time);
|
||||
#elif defined(HAVE_BIO_IO_ACCT)
|
||||
bio_end_io_acct(bio, start_time);
|
||||
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
||||
generic_end_io_acct(rw, &disk->part0, start_time);
|
||||
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
|
||||
generic_end_io_acct(q, rw, &disk->part0, start_time);
|
||||
#endif
|
||||
|
@ -718,7 +549,6 @@ blk_generic_alloc_queue(make_request_fn make_request, int node_id)
|
|||
static inline int
|
||||
io_data_dir(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL) {
|
||||
if (op_is_write(req_op(rq))) {
|
||||
return (WRITE);
|
||||
|
@ -726,57 +556,38 @@ io_data_dir(struct bio *bio, struct request *rq)
|
|||
return (READ);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_data_dir(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_flush(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (req_op(rq) == REQ_OP_FLUSH);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_flush(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_discard(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (req_op(rq) == REQ_OP_DISCARD);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_discard(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_secure_erase(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (req_op(rq) == REQ_OP_SECURE_ERASE);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_secure_erase(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_fua(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (rq->cmd_flags & REQ_FUA);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_fua(bio));
|
||||
}
|
||||
|
||||
|
@ -784,36 +595,24 @@ io_is_fua(struct bio *bio, struct request *rq)
|
|||
static inline uint64_t
|
||||
io_offset(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (blk_rq_pos(rq) << 9);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (BIO_BI_SECTOR(bio) << 9);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
io_size(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (blk_rq_bytes(rq));
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (BIO_BI_SIZE(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_has_data(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (bio_has_data(rq->bio));
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_has_data(bio));
|
||||
}
|
||||
#endif /* _ZFS_BLKDEV_H */
|
||||
|
|
|
@ -31,13 +31,7 @@
|
|||
#define dname(dentry) ((char *)((dentry)->d_name.name))
|
||||
#define dlen(dentry) ((int)((dentry)->d_name.len))
|
||||
|
||||
#ifndef HAVE_D_MAKE_ROOT
|
||||
#define d_make_root(inode) d_alloc_root(inode)
|
||||
#endif /* HAVE_D_MAKE_ROOT */
|
||||
|
||||
#ifdef HAVE_DENTRY_D_U_ALIASES
|
||||
#define d_alias d_u.d_alias
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Starting from Linux 5.13, flush_dcache_page() becomes an inline function
|
||||
|
|
|
@ -1,67 +1,11 @@
|
|||
#ifndef _ZFS_PAGE_COMPAT_H
|
||||
#define _ZFS_PAGE_COMPAT_H
|
||||
|
||||
/*
|
||||
* We have various enum members moving between two separate enum types,
|
||||
* and accessed by different functions at various times. Centralise the
|
||||
* insanity.
|
||||
*
|
||||
* < v4.8: all enums in zone_stat_item, via global_page_state()
|
||||
* v4.8: some enums moved to node_stat_item, global_node_page_state() introduced
|
||||
* v4.13: some enums moved from zone_stat_item to node_state_item
|
||||
* v4.14: global_page_state() rename to global_zone_page_state()
|
||||
*
|
||||
* The defines used here are created by config/kernel-global_page_state.m4
|
||||
*/
|
||||
|
||||
/*
|
||||
* Create our own accessor functions to follow the Linux API changes
|
||||
*/
|
||||
#if defined(ZFS_GLOBAL_ZONE_PAGE_STATE)
|
||||
|
||||
/* global_zone_page_state() introduced */
|
||||
#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES)
|
||||
#define nr_file_pages() global_node_page_state(NR_FILE_PAGES)
|
||||
#else
|
||||
#define nr_file_pages() global_zone_page_state(NR_FILE_PAGES)
|
||||
#endif
|
||||
#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON)
|
||||
#define nr_inactive_anon_pages() global_node_page_state(NR_INACTIVE_ANON)
|
||||
#else
|
||||
#define nr_inactive_anon_pages() global_zone_page_state(NR_INACTIVE_ANON)
|
||||
#endif
|
||||
#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE)
|
||||
#define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
|
||||
#else
|
||||
#define nr_inactive_file_pages() global_zone_page_state(NR_INACTIVE_FILE)
|
||||
#endif
|
||||
|
||||
#elif defined(ZFS_GLOBAL_NODE_PAGE_STATE)
|
||||
|
||||
/* global_node_page_state() introduced */
|
||||
#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES)
|
||||
#define nr_file_pages() global_node_page_state(NR_FILE_PAGES)
|
||||
#else
|
||||
#define nr_file_pages() global_page_state(NR_FILE_PAGES)
|
||||
#endif
|
||||
#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON)
|
||||
#define nr_inactive_anon_pages() global_node_page_state(NR_INACTIVE_ANON)
|
||||
#else
|
||||
#define nr_inactive_anon_pages() global_page_state(NR_INACTIVE_ANON)
|
||||
#endif
|
||||
#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE)
|
||||
#define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
|
||||
#else
|
||||
#define nr_inactive_file_pages() global_page_state(NR_INACTIVE_FILE)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/* global_page_state() only */
|
||||
#define nr_file_pages() global_page_state(NR_FILE_PAGES)
|
||||
#define nr_inactive_anon_pages() global_page_state(NR_INACTIVE_ANON)
|
||||
#define nr_inactive_file_pages() global_page_state(NR_INACTIVE_FILE)
|
||||
|
||||
#endif /* ZFS_GLOBAL_ZONE_PAGE_STATE */
|
||||
|
||||
#endif /* _ZFS_PAGE_COMPAT_H */
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or https://opensource.org/licenses/CDDL-1.0.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2020 by Delphix. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _ZFS_PERCPU_H
|
||||
#define _ZFS_PERCPU_H
|
||||
|
||||
#include <linux/percpu_counter.h>
|
||||
|
||||
/*
|
||||
* 3.18 API change,
|
||||
* percpu_counter_init() now must be passed a gfp mask which will be
|
||||
* used for the dynamic allocation of the actual counter.
|
||||
*/
|
||||
#ifdef HAVE_PERCPU_COUNTER_INIT_WITH_GFP
|
||||
#define percpu_counter_init_common(counter, n, gfp) \
|
||||
percpu_counter_init(counter, n, gfp)
|
||||
#else
|
||||
#define percpu_counter_init_common(counter, n, gfp) \
|
||||
percpu_counter_init(counter, n)
|
||||
#endif
|
||||
|
||||
#endif /* _ZFS_PERCPU_H */
|
|
@ -32,82 +32,6 @@
|
|||
#include <linux/backing-dev.h>
|
||||
#include <linux/compat.h>
|
||||
|
||||
/*
|
||||
* 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
|
||||
* 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||
* 4.12 - x.y, super_setup_bdi_name() new interface.
|
||||
*/
|
||||
#if defined(HAVE_SUPER_SETUP_BDI_NAME)
|
||||
extern atomic_long_t zfs_bdi_seq;
|
||||
|
||||
static inline int
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
return super_setup_bdi_name(sb, "%.28s-%ld", name,
|
||||
atomic_long_inc_return(&zfs_bdi_seq));
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
}
|
||||
#elif defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER)
|
||||
static inline int
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
struct backing_dev_info *bdi;
|
||||
int error;
|
||||
|
||||
bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP);
|
||||
error = bdi_setup_and_register(bdi, name);
|
||||
if (error) {
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
sb->s_bdi = bdi;
|
||||
|
||||
return (0);
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
struct backing_dev_info *bdi = sb->s_bdi;
|
||||
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#elif defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER)
|
||||
static inline int
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
struct backing_dev_info *bdi;
|
||||
int error;
|
||||
|
||||
bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP);
|
||||
error = bdi_setup_and_register(bdi, name, BDI_CAP_MAP_COPY);
|
||||
if (error) {
|
||||
kmem_free(sb->s_bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
sb->s_bdi = bdi;
|
||||
|
||||
return (0);
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
struct backing_dev_info *bdi = sb->s_bdi;
|
||||
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.14 adds SB_* flag definitions, define them to MS_* equivalents
|
||||
* if not set.
|
||||
|
@ -136,17 +60,7 @@ zpl_bdi_destroy(struct super_block *sb)
|
|||
#define SB_NOATIME MS_NOATIME
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 3.5 API change,
|
||||
* The clear_inode() function replaces end_writeback() and introduces an
|
||||
* ordering change regarding when the inode_sync_wait() occurs. See the
|
||||
* configure check in config/kernel-clear-inode.m4 for full details.
|
||||
*/
|
||||
#if defined(HAVE_EVICT_INODE) && !defined(HAVE_CLEAR_INODE)
|
||||
#define clear_inode(ip) end_writeback(ip)
|
||||
#endif /* HAVE_EVICT_INODE && !HAVE_CLEAR_INODE */
|
||||
|
||||
#if defined(SEEK_HOLE) && defined(SEEK_DATA) && !defined(HAVE_LSEEK_EXECUTE)
|
||||
#if defined(SEEK_HOLE) && defined(SEEK_DATA)
|
||||
static inline loff_t
|
||||
lseek_execute(
|
||||
struct file *filp,
|
||||
|
@ -169,7 +83,7 @@ lseek_execute(
|
|||
|
||||
return (offset);
|
||||
}
|
||||
#endif /* SEEK_HOLE && SEEK_DATA && !HAVE_LSEEK_EXECUTE */
|
||||
#endif /* SEEK_HOLE && SEEK_DATA */
|
||||
|
||||
#if defined(CONFIG_FS_POSIX_ACL)
|
||||
/*
|
||||
|
@ -184,9 +98,6 @@ lseek_execute(
|
|||
|
||||
#include <linux/posix_acl.h>
|
||||
|
||||
#if defined(HAVE_POSIX_ACL_RELEASE) && !defined(HAVE_POSIX_ACL_RELEASE_GPL_ONLY)
|
||||
#define zpl_posix_acl_release(arg) posix_acl_release(arg)
|
||||
#else
|
||||
void zpl_posix_acl_release_impl(struct posix_acl *);
|
||||
|
||||
static inline void
|
||||
|
@ -194,106 +105,11 @@ zpl_posix_acl_release(struct posix_acl *acl)
|
|||
{
|
||||
if ((acl == NULL) || (acl == ACL_NOT_CACHED))
|
||||
return;
|
||||
#ifdef HAVE_ACL_REFCOUNT
|
||||
if (refcount_dec_and_test(&acl->a_refcount))
|
||||
zpl_posix_acl_release_impl(acl);
|
||||
#else
|
||||
if (atomic_dec_and_test(&acl->a_refcount))
|
||||
zpl_posix_acl_release_impl(acl);
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_POSIX_ACL_RELEASE */
|
||||
|
||||
#ifdef HAVE_SET_CACHED_ACL_USABLE
|
||||
#define zpl_set_cached_acl(ip, ty, n) set_cached_acl(ip, ty, n)
|
||||
#define zpl_forget_cached_acl(ip, ty) forget_cached_acl(ip, ty)
|
||||
#else
|
||||
static inline void
|
||||
zpl_set_cached_acl(struct inode *ip, int type, struct posix_acl *newer)
|
||||
{
|
||||
struct posix_acl *older = NULL;
|
||||
|
||||
spin_lock(&ip->i_lock);
|
||||
|
||||
if ((newer != ACL_NOT_CACHED) && (newer != NULL))
|
||||
posix_acl_dup(newer);
|
||||
|
||||
switch (type) {
|
||||
case ACL_TYPE_ACCESS:
|
||||
older = ip->i_acl;
|
||||
rcu_assign_pointer(ip->i_acl, newer);
|
||||
break;
|
||||
case ACL_TYPE_DEFAULT:
|
||||
older = ip->i_default_acl;
|
||||
rcu_assign_pointer(ip->i_default_acl, newer);
|
||||
break;
|
||||
}
|
||||
|
||||
spin_unlock(&ip->i_lock);
|
||||
|
||||
zpl_posix_acl_release(older);
|
||||
}
|
||||
|
||||
static inline void
|
||||
zpl_forget_cached_acl(struct inode *ip, int type)
|
||||
{
|
||||
zpl_set_cached_acl(ip, type, (struct posix_acl *)ACL_NOT_CACHED);
|
||||
}
|
||||
#endif /* HAVE_SET_CACHED_ACL_USABLE */
|
||||
|
||||
/*
|
||||
* 3.1 API change,
|
||||
* posix_acl_chmod() was added as the preferred interface.
|
||||
*
|
||||
* 3.14 API change,
|
||||
* posix_acl_chmod() was changed to __posix_acl_chmod()
|
||||
*/
|
||||
#ifndef HAVE___POSIX_ACL_CHMOD
|
||||
#ifdef HAVE_POSIX_ACL_CHMOD
|
||||
#define __posix_acl_chmod(acl, gfp, mode) posix_acl_chmod(acl, gfp, mode)
|
||||
#define __posix_acl_create(acl, gfp, mode) posix_acl_create(acl, gfp, mode)
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif /* HAVE_POSIX_ACL_CHMOD */
|
||||
#endif /* HAVE___POSIX_ACL_CHMOD */
|
||||
|
||||
/*
|
||||
* 4.8 API change,
|
||||
* posix_acl_valid() now must be passed a namespace, the namespace from
|
||||
* from super block associated with the given inode is used for this purpose.
|
||||
*/
|
||||
#ifdef HAVE_POSIX_ACL_VALID_WITH_NS
|
||||
#define zpl_posix_acl_valid(ip, acl) posix_acl_valid(ip->i_sb->s_user_ns, acl)
|
||||
#else
|
||||
#define zpl_posix_acl_valid(ip, acl) posix_acl_valid(acl)
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_FS_POSIX_ACL */
|
||||
|
||||
/*
|
||||
* 3.19 API change
|
||||
* struct access f->f_dentry->d_inode was replaced by accessor function
|
||||
* file_inode(f)
|
||||
*/
|
||||
#ifndef HAVE_FILE_INODE
|
||||
static inline struct inode *file_inode(const struct file *f)
|
||||
{
|
||||
return (f->f_dentry->d_inode);
|
||||
}
|
||||
#endif /* HAVE_FILE_INODE */
|
||||
|
||||
/*
|
||||
* 4.1 API change
|
||||
* struct access file->f_path.dentry was replaced by accessor function
|
||||
* file_dentry(f)
|
||||
*/
|
||||
#ifndef HAVE_FILE_DENTRY
|
||||
static inline struct dentry *file_dentry(const struct file *f)
|
||||
{
|
||||
return (f->f_path.dentry);
|
||||
}
|
||||
#endif /* HAVE_FILE_DENTRY */
|
||||
|
||||
static inline uid_t zfs_uid_read_impl(struct inode *ip)
|
||||
{
|
||||
return (from_kuid(kcred->user_ns, ip->i_uid));
|
||||
|
@ -371,16 +187,7 @@ setattr_prepare(struct dentry *dentry, struct iattr *ia)
|
|||
* 4.11 takes struct path *, < 4.11 takes vfsmount *
|
||||
*/
|
||||
|
||||
#ifdef HAVE_VFSMOUNT_IOPS_GETATTR
|
||||
#define ZPL_GETATTR_WRAPPER(func) \
|
||||
static int \
|
||||
func(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) \
|
||||
{ \
|
||||
struct path path = { .mnt = mnt, .dentry = dentry }; \
|
||||
return func##_impl(&path, stat, STATX_BASIC_STATS, \
|
||||
AT_STATX_SYNC_AS_STAT); \
|
||||
}
|
||||
#elif defined(HAVE_PATH_IOPS_GETATTR)
|
||||
#if defined(HAVE_PATH_IOPS_GETATTR)
|
||||
#define ZPL_GETATTR_WRAPPER(func) \
|
||||
static int \
|
||||
func(const struct path *path, struct kstat *stat, u32 request_mask, \
|
||||
|
@ -410,32 +217,6 @@ func(struct mnt_idmap *user_ns, const struct path *path, \
|
|||
#error
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.9 API change
|
||||
* Preferred interface to get the current FS time.
|
||||
*/
|
||||
#if !defined(HAVE_CURRENT_TIME)
|
||||
static inline struct timespec
|
||||
current_time(struct inode *ip)
|
||||
{
|
||||
return (timespec_trunc(current_kernel_time(), ip->i_sb->s_time_gran));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.16 API change
|
||||
* Added iversion interface for managing inode version field.
|
||||
*/
|
||||
#ifdef HAVE_INODE_SET_IVERSION
|
||||
#include <linux/iversion.h>
|
||||
#else
|
||||
static inline void
|
||||
inode_set_iversion(struct inode *ip, u64 val)
|
||||
{
|
||||
ip->i_version = val;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns true when called in the context of a 32-bit system call.
|
||||
*/
|
||||
|
@ -443,11 +224,7 @@ static inline int
|
|||
zpl_is_32bit_api(void)
|
||||
{
|
||||
#ifdef CONFIG_COMPAT
|
||||
#ifdef HAVE_IN_COMPAT_SYSCALL
|
||||
return (in_compat_syscall());
|
||||
#else
|
||||
return (is_compat_task());
|
||||
#endif
|
||||
#else
|
||||
return (BITS_PER_LONG == 32);
|
||||
#endif
|
||||
|
|
|
@ -40,87 +40,18 @@ typedef const struct xattr_handler xattr_handler_t;
|
|||
/*
|
||||
* 4.5 API change,
|
||||
*/
|
||||
#if defined(HAVE_XATTR_LIST_SIMPLE)
|
||||
#define ZPL_XATTR_LIST_WRAPPER(fn) \
|
||||
static bool \
|
||||
fn(struct dentry *dentry) \
|
||||
{ \
|
||||
return (!!__ ## fn(dentry->d_inode, NULL, 0, NULL, 0)); \
|
||||
}
|
||||
/*
|
||||
* 4.4 API change,
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_LIST_DENTRY)
|
||||
#define ZPL_XATTR_LIST_WRAPPER(fn) \
|
||||
static size_t \
|
||||
fn(struct dentry *dentry, char *list, size_t list_size, \
|
||||
const char *name, size_t name_len, int type) \
|
||||
{ \
|
||||
return (__ ## fn(dentry->d_inode, \
|
||||
list, list_size, name, name_len)); \
|
||||
}
|
||||
/*
|
||||
* 2.6.33 API change,
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_LIST_HANDLER)
|
||||
#define ZPL_XATTR_LIST_WRAPPER(fn) \
|
||||
static size_t \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
char *list, size_t list_size, const char *name, size_t name_len) \
|
||||
{ \
|
||||
return (__ ## fn(dentry->d_inode, \
|
||||
list, list_size, name, name_len)); \
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 4.7 API change,
|
||||
* The xattr_handler->get() callback was changed to take a both dentry and
|
||||
* inode, because the dentry might not be attached to an inode yet.
|
||||
*/
|
||||
#if defined(HAVE_XATTR_GET_DENTRY_INODE)
|
||||
#define ZPL_XATTR_GET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
struct inode *inode, const char *name, void *buffer, size_t size) \
|
||||
{ \
|
||||
return (__ ## fn(inode, name, buffer, size)); \
|
||||
}
|
||||
/*
|
||||
* 4.4 API change,
|
||||
* The xattr_handler->get() callback was changed to take a xattr_handler,
|
||||
* and handler_flags argument was removed and should be accessed by
|
||||
* handler->flags.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_GET_HANDLER)
|
||||
#define ZPL_XATTR_GET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
const char *name, void *buffer, size_t size) \
|
||||
{ \
|
||||
return (__ ## fn(dentry->d_inode, name, buffer, size)); \
|
||||
}
|
||||
/*
|
||||
* 2.6.33 API change,
|
||||
* The xattr_handler->get() callback was changed to take a dentry
|
||||
* instead of an inode, and a handler_flags argument was added.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_GET_DENTRY)
|
||||
#define ZPL_XATTR_GET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(struct dentry *dentry, const char *name, void *buffer, size_t size, \
|
||||
int unused_handler_flags) \
|
||||
{ \
|
||||
return (__ ## fn(dentry->d_inode, name, buffer, size)); \
|
||||
}
|
||||
#ifdef HAVE_XATTR_GET_DENTRY_INODE_FLAGS
|
||||
/*
|
||||
* Android API change,
|
||||
* The xattr_handler->get() callback was changed to take a dentry and inode
|
||||
* and flags, because the dentry might not be attached to an inode yet.
|
||||
* The xattr_handler->get() callback also takes a flags arg.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_GET_DENTRY_INODE_FLAGS)
|
||||
#define ZPL_XATTR_GET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
|
@ -130,7 +61,13 @@ fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
|||
return (__ ## fn(inode, name, buffer, size)); \
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#define ZPL_XATTR_GET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
struct inode *inode, const char *name, void *buffer, size_t size) \
|
||||
{ \
|
||||
return (__ ## fn(inode, name, buffer, size)); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -177,35 +114,6 @@ fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
|||
{ \
|
||||
return (__ ## fn(kcred->user_ns, inode, name, buffer, size, flags));\
|
||||
}
|
||||
/*
|
||||
* 4.4 API change,
|
||||
* The xattr_handler->set() callback was changed to take a xattr_handler,
|
||||
* and handler_flags argument was removed and should be accessed by
|
||||
* handler->flags.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_SET_HANDLER)
|
||||
#define ZPL_XATTR_SET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(const struct xattr_handler *handler, struct dentry *dentry, \
|
||||
const char *name, const void *buffer, size_t size, int flags) \
|
||||
{ \
|
||||
return (__ ## fn(kcred->user_ns, dentry->d_inode, name, \
|
||||
buffer, size, flags)); \
|
||||
}
|
||||
/*
|
||||
* 2.6.33 API change,
|
||||
* The xattr_handler->set() callback was changed to take a dentry
|
||||
* instead of an inode, and a handler_flags argument was added.
|
||||
*/
|
||||
#elif defined(HAVE_XATTR_SET_DENTRY)
|
||||
#define ZPL_XATTR_SET_WRAPPER(fn) \
|
||||
static int \
|
||||
fn(struct dentry *dentry, const char *name, const void *buffer, \
|
||||
size_t size, int flags, int unused_handler_flags) \
|
||||
{ \
|
||||
return (__ ## fn(kcred->user_ns, dentry->d_inode, name, \
|
||||
buffer, size, flags)); \
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
|
|
@ -66,8 +66,8 @@
|
|||
|
||||
typedef struct {
|
||||
int cv_magic;
|
||||
spl_wait_queue_head_t cv_event;
|
||||
spl_wait_queue_head_t cv_destroy;
|
||||
wait_queue_head_t cv_event;
|
||||
wait_queue_head_t cv_destroy;
|
||||
atomic_t cv_refs;
|
||||
atomic_t cv_waiters;
|
||||
kmutex_t *cv_mutex;
|
||||
|
|
|
@ -63,11 +63,7 @@ zfs_is_init_userns(struct user_namespace *user_ns)
|
|||
|
||||
static inline struct user_namespace *zfs_i_user_ns(struct inode *inode)
|
||||
{
|
||||
#ifdef HAVE_SUPER_USER_NS
|
||||
return (inode->i_sb->s_user_ns);
|
||||
#else
|
||||
return (kcred->user_ns);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline boolean_t zfs_no_idmapping(struct user_namespace *mnt_userns,
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#define FKIOCTL 0x80000000
|
||||
#define ED_CASE_CONFLICT 0x10
|
||||
|
||||
#ifdef HAVE_INODE_LOCK_SHARED
|
||||
#define spl_inode_lock(ip) inode_lock(ip)
|
||||
#define spl_inode_unlock(ip) inode_unlock(ip)
|
||||
#define spl_inode_lock_shared(ip) inode_lock_shared(ip)
|
||||
|
@ -37,15 +36,5 @@
|
|||
#define spl_inode_trylock_shared(ip) inode_trylock_shared(ip)
|
||||
#define spl_inode_is_locked(ip) inode_is_locked(ip)
|
||||
#define spl_inode_lock_nested(ip, s) inode_lock_nested(ip, s)
|
||||
#else
|
||||
#define spl_inode_lock(ip) mutex_lock(&(ip)->i_mutex)
|
||||
#define spl_inode_unlock(ip) mutex_unlock(&(ip)->i_mutex)
|
||||
#define spl_inode_lock_shared(ip) mutex_lock(&(ip)->i_mutex)
|
||||
#define spl_inode_unlock_shared(ip) mutex_unlock(&(ip)->i_mutex)
|
||||
#define spl_inode_trylock(ip) mutex_trylock(&(ip)->i_mutex)
|
||||
#define spl_inode_trylock_shared(ip) mutex_trylock(&(ip)->i_mutex)
|
||||
#define spl_inode_is_locked(ip) mutex_is_locked(&(ip)->i_mutex)
|
||||
#define spl_inode_lock_nested(ip, s) mutex_lock_nested(&(ip)->i_mutex, s)
|
||||
#endif
|
||||
|
||||
#endif /* SPL_FILE_H */
|
||||
|
|
|
@ -160,7 +160,7 @@ typedef struct spl_kmem_cache {
|
|||
struct list_head skc_partial_list; /* Partially alloc'ed */
|
||||
struct rb_root skc_emergency_tree; /* Min sized objects */
|
||||
spinlock_t skc_lock; /* Cache lock */
|
||||
spl_wait_queue_head_t skc_waitq; /* Allocation waiters */
|
||||
wait_queue_head_t skc_waitq; /* Allocation waiters */
|
||||
uint64_t skc_slab_fail; /* Slab alloc failures */
|
||||
uint64_t skc_slab_create; /* Slab creates */
|
||||
uint64_t skc_slab_destroy; /* Slab destroys */
|
||||
|
|
|
@ -25,10 +25,7 @@
|
|||
#define _SPL_SIGNAL_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
#ifdef HAVE_SCHED_SIGNAL_HEADER
|
||||
#include <linux/sched/signal.h>
|
||||
#endif
|
||||
|
||||
extern int issig(void);
|
||||
|
||||
|
|
|
@ -25,10 +25,7 @@
|
|||
|
||||
#include <linux/string.h>
|
||||
|
||||
/* Fallbacks for kernel missing strlcpy */
|
||||
#ifndef HAVE_KERNEL_STRLCPY
|
||||
|
||||
#if defined(HAVE_KERNEL_STRSCPY)
|
||||
/*
|
||||
* strscpy is strlcpy, but returns an error on truncation. strlcpy is defined
|
||||
* to return strlen(src), so detect error and override it.
|
||||
|
@ -41,10 +38,6 @@ strlcpy(char *dest, const char *src, size_t size)
|
|||
return ((size_t)ret);
|
||||
return (strlen(src));
|
||||
}
|
||||
#else
|
||||
#error "no strlcpy fallback available"
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_KERNEL_STRLCPY */
|
||||
|
||||
#endif /* _SPL_STRING_H */
|
||||
|
|
|
@ -131,8 +131,8 @@ typedef struct taskq {
|
|||
struct list_head tq_prio_list; /* priority taskq_ent_t's */
|
||||
struct list_head tq_delay_list; /* delayed taskq_ent_t's */
|
||||
struct list_head tq_taskqs; /* all taskq_t's */
|
||||
spl_wait_queue_head_t tq_work_waitq; /* new work waitq */
|
||||
spl_wait_queue_head_t tq_wait_waitq; /* wait waitq */
|
||||
wait_queue_head_t tq_work_waitq; /* new work waitq */
|
||||
wait_queue_head_t tq_wait_waitq; /* wait waitq */
|
||||
tq_lock_role_t tq_lock_class; /* class when taking tq_lock */
|
||||
/* list node for the cpu hotplug callback */
|
||||
struct hlist_node tq_hp_cb_node;
|
||||
|
@ -144,7 +144,7 @@ typedef struct taskq {
|
|||
|
||||
typedef struct taskq_ent {
|
||||
spinlock_t tqent_lock;
|
||||
spl_wait_queue_head_t tqent_waitq;
|
||||
wait_queue_head_t tqent_waitq;
|
||||
struct timer_list tqent_timer;
|
||||
struct list_head tqent_list;
|
||||
taskqid_t tqent_id;
|
||||
|
|
|
@ -80,11 +80,4 @@ typedef kernel_siginfo_t spl_kernel_siginfo_t;
|
|||
typedef siginfo_t spl_kernel_siginfo_t;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SET_SPECIAL_STATE
|
||||
#define spl_set_special_state(x) set_special_state((x))
|
||||
#else
|
||||
#define spl_set_special_state(x) __set_current_state((x))
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _SPL_THREAD_H */
|
||||
|
|
|
@ -59,11 +59,7 @@ typedef struct timespec timespec_t;
|
|||
#define TIMESPEC_OVERFLOW(ts) \
|
||||
((ts)->tv_sec < TIME_MIN || (ts)->tv_sec > TIME_MAX)
|
||||
|
||||
#if defined(HAVE_INODE_TIMESPEC64_TIMES)
|
||||
typedef struct timespec64 inode_timespec_t;
|
||||
#else
|
||||
typedef struct timespec inode_timespec_t;
|
||||
#endif
|
||||
|
||||
/* Include for Lustre compatibility */
|
||||
#define timestruc_t inode_timespec_t
|
||||
|
@ -71,46 +67,22 @@ typedef struct timespec inode_timespec_t;
|
|||
static inline void
|
||||
gethrestime(inode_timespec_t *ts)
|
||||
{
|
||||
#if defined(HAVE_INODE_TIMESPEC64_TIMES)
|
||||
|
||||
#if defined(HAVE_KTIME_GET_COARSE_REAL_TS64)
|
||||
ktime_get_coarse_real_ts64(ts);
|
||||
#else
|
||||
*ts = current_kernel_time64();
|
||||
#endif /* HAVE_KTIME_GET_COARSE_REAL_TS64 */
|
||||
|
||||
#else
|
||||
*ts = current_kernel_time();
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
gethrestime_sec(void)
|
||||
{
|
||||
#if defined(HAVE_INODE_TIMESPEC64_TIMES)
|
||||
#if defined(HAVE_KTIME_GET_COARSE_REAL_TS64)
|
||||
inode_timespec_t ts;
|
||||
ktime_get_coarse_real_ts64(&ts);
|
||||
#else
|
||||
inode_timespec_t ts = current_kernel_time64();
|
||||
#endif /* HAVE_KTIME_GET_COARSE_REAL_TS64 */
|
||||
|
||||
#else
|
||||
inode_timespec_t ts = current_kernel_time();
|
||||
#endif
|
||||
return (ts.tv_sec);
|
||||
}
|
||||
|
||||
static inline hrtime_t
|
||||
gethrtime(void)
|
||||
{
|
||||
#if defined(HAVE_KTIME_GET_RAW_TS64)
|
||||
struct timespec64 ts;
|
||||
ktime_get_raw_ts64(&ts);
|
||||
#else
|
||||
struct timespec ts;
|
||||
getrawmonotonic(&ts);
|
||||
#endif
|
||||
return (((hrtime_t)ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,24 +62,4 @@
|
|||
container_of(timer, typeof(*var), timer_field)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST
|
||||
typedef struct timer_list *spl_timer_list_t;
|
||||
#else
|
||||
typedef unsigned long spl_timer_list_t;
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_KERNEL_TIMER_SETUP
|
||||
|
||||
static inline void
|
||||
timer_setup(struct timer_list *timer, void (*func)(spl_timer_list_t), u32 fl)
|
||||
{
|
||||
#ifdef HAVE_KERNEL_TIMER_LIST_FLAGS
|
||||
(timer)->flags = fl;
|
||||
#endif
|
||||
init_timer(timer);
|
||||
setup_timer(timer, func, (spl_timer_list_t)(timer));
|
||||
}
|
||||
|
||||
#endif /* HAVE_KERNEL_TIMER_SETUP */
|
||||
|
||||
#endif /* _SPL_TIMER_H */
|
||||
|
|
|
@ -27,28 +27,4 @@
|
|||
#include <linux/sched.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
#ifndef HAVE_WAIT_ON_BIT_ACTION
|
||||
#define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode)
|
||||
#else
|
||||
|
||||
static inline int
|
||||
spl_bit_wait(void *word)
|
||||
{
|
||||
schedule();
|
||||
return (0);
|
||||
}
|
||||
|
||||
#define spl_wait_on_bit(word, bit, mode) \
|
||||
wait_on_bit(word, bit, spl_bit_wait, mode)
|
||||
|
||||
#endif /* HAVE_WAIT_ON_BIT_ACTION */
|
||||
|
||||
#ifdef HAVE_WAIT_QUEUE_ENTRY_T
|
||||
typedef wait_queue_head_t spl_wait_queue_head_t;
|
||||
typedef wait_queue_entry_t spl_wait_queue_entry_t;
|
||||
#else
|
||||
typedef wait_queue_head_t spl_wait_queue_head_t;
|
||||
typedef wait_queue_t spl_wait_queue_entry_t;
|
||||
#endif
|
||||
|
||||
#endif /* SPL_WAIT_H */
|
||||
|
|
|
@ -36,12 +36,7 @@ typedef struct percpu_counter wmsum_t;
|
|||
static inline void
|
||||
wmsum_init(wmsum_t *ws, uint64_t value)
|
||||
{
|
||||
|
||||
#ifdef HAVE_PERCPU_COUNTER_INIT_WITH_GFP
|
||||
percpu_counter_init(ws, value, GFP_KERNEL);
|
||||
#else
|
||||
percpu_counter_init(ws, value);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -62,11 +57,7 @@ static inline void
|
|||
wmsum_add(wmsum_t *ws, int64_t delta)
|
||||
{
|
||||
|
||||
#ifdef HAVE_PERCPU_COUNTER_ADD_BATCH
|
||||
percpu_counter_add_batch(ws, delta, INT_MAX / 2);
|
||||
#else
|
||||
__percpu_counter_add(ws, delta, INT_MAX / 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -55,7 +55,7 @@ extern int zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap,
|
|||
znode_t **zpp, cred_t *cr, int flags, vsecattr_t *vsecp, zidmap_t *mnt_ns);
|
||||
extern int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd,
|
||||
cred_t *cr, int flags);
|
||||
extern int zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr);
|
||||
extern int zfs_readdir(struct inode *ip, struct dir_context *ctx, cred_t *cr);
|
||||
#ifdef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK
|
||||
extern int zfs_getattr_fast(zidmap_t *, u32 request_mask, struct inode *ip,
|
||||
struct kstat *sp);
|
||||
|
|
|
@ -47,16 +47,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
|
||||
#define ZNODE_OS_FIELDS \
|
||||
inode_timespec_t z_btime; /* creation/birth time (cached) */ \
|
||||
struct inode z_inode;
|
||||
#else
|
||||
#define ZNODE_OS_FIELDS \
|
||||
inode_timespec_t z_btime; /* creation/birth time (cached) */ \
|
||||
struct inode z_inode; \
|
||||
boolean_t z_is_mapped; /* we are mmap'ed */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Convert between znode pointers and inode pointers
|
||||
|
@ -77,13 +70,8 @@ extern "C" {
|
|||
#define Z_ISDEV(type) (S_ISCHR(type) || S_ISBLK(type) || S_ISFIFO(type))
|
||||
#define Z_ISDIR(type) S_ISDIR(type)
|
||||
|
||||
#if defined(HAVE_FILEMAP_RANGE_HAS_PAGE)
|
||||
#define zn_has_cached_data(zp, start, end) \
|
||||
filemap_range_has_page(ZTOI(zp)->i_mapping, start, end)
|
||||
#else
|
||||
#define zn_has_cached_data(zp, start, end) \
|
||||
((zp)->z_is_mapped)
|
||||
#endif
|
||||
|
||||
#define zn_flush_cached_data(zp, sync) write_inode_now(ZTOI(zp), sync)
|
||||
#define zn_rlimit_fsize(size) (0)
|
||||
|
@ -153,27 +141,14 @@ do { \
|
|||
(stmp)[1] = (uint64_t)(tp)->tv_nsec; \
|
||||
} while (0)
|
||||
|
||||
#if defined(HAVE_INODE_TIMESPEC64_TIMES)
|
||||
/*
|
||||
* Decode ZFS stored time values to a struct timespec64
|
||||
* 4.18 and newer kernels.
|
||||
*/
|
||||
#define ZFS_TIME_DECODE(tp, stmp) \
|
||||
do { \
|
||||
(tp)->tv_sec = (time64_t)(stmp)[0]; \
|
||||
(tp)->tv_nsec = (long)(stmp)[1]; \
|
||||
} while (0)
|
||||
#else
|
||||
/*
|
||||
* Decode ZFS stored time values to a struct timespec
|
||||
* 4.17 and older kernels.
|
||||
*/
|
||||
#define ZFS_TIME_DECODE(tp, stmp) \
|
||||
do { \
|
||||
(tp)->tv_sec = (time_t)(stmp)[0]; \
|
||||
(tp)->tv_nsec = (long)(stmp)[1]; \
|
||||
} while (0)
|
||||
#endif /* HAVE_INODE_TIMESPEC64_TIMES */
|
||||
|
||||
#define ZFS_ACCESSTIME_STAMP(zfsvfs, zp)
|
||||
|
||||
|
|
|
@ -42,21 +42,13 @@ extern void zpl_vap_init(vattr_t *vap, struct inode *dir,
|
|||
umode_t mode, cred_t *cr, zidmap_t *mnt_ns);
|
||||
|
||||
extern const struct inode_operations zpl_inode_operations;
|
||||
#ifdef HAVE_RENAME2_OPERATIONS_WRAPPER
|
||||
extern const struct inode_operations_wrapper zpl_dir_inode_operations;
|
||||
#else
|
||||
extern const struct inode_operations zpl_dir_inode_operations;
|
||||
#endif
|
||||
extern const struct inode_operations zpl_symlink_inode_operations;
|
||||
extern const struct inode_operations zpl_special_inode_operations;
|
||||
|
||||
/* zpl_file.c */
|
||||
extern const struct address_space_operations zpl_address_space_operations;
|
||||
#ifdef HAVE_VFS_FILE_OPERATIONS_EXTEND
|
||||
extern const struct file_operations_extend zpl_file_operations;
|
||||
#else
|
||||
extern const struct file_operations zpl_file_operations;
|
||||
#endif
|
||||
extern const struct file_operations zpl_dir_file_operations;
|
||||
|
||||
/* zpl_super.c */
|
||||
|
@ -70,8 +62,9 @@ extern struct file_system_type zpl_fs_type;
|
|||
extern ssize_t zpl_xattr_list(struct dentry *dentry, char *buf, size_t size);
|
||||
extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip,
|
||||
const struct qstr *qstr);
|
||||
|
||||
#if defined(CONFIG_FS_POSIX_ACL)
|
||||
#if defined(HAVE_SET_ACL)
|
||||
|
||||
#if defined(HAVE_SET_ACL_IDMAP_DENTRY)
|
||||
extern int zpl_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||
struct posix_acl *acl, int type);
|
||||
|
@ -84,7 +77,7 @@ extern int zpl_set_acl(struct user_namespace *userns, struct dentry *dentry,
|
|||
#else
|
||||
extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
|
||||
#endif /* HAVE_SET_ACL_USERNS */
|
||||
#endif /* HAVE_SET_ACL */
|
||||
|
||||
#if defined(HAVE_GET_ACL_RCU) || defined(HAVE_GET_INODE_ACL)
|
||||
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type, bool rcu);
|
||||
#elif defined(HAVE_GET_ACL)
|
||||
|
@ -118,73 +111,6 @@ extern const struct inode_operations zpl_ops_snapdir;
|
|||
extern const struct file_operations zpl_fops_shares;
|
||||
extern const struct inode_operations zpl_ops_shares;
|
||||
|
||||
#if defined(HAVE_VFS_ITERATE) || defined(HAVE_VFS_ITERATE_SHARED)
|
||||
|
||||
#define ZPL_DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
|
||||
.actor = _actor, \
|
||||
.pos = _pos, \
|
||||
}
|
||||
|
||||
typedef struct dir_context zpl_dir_context_t;
|
||||
|
||||
#define zpl_dir_emit dir_emit
|
||||
#define zpl_dir_emit_dot dir_emit_dot
|
||||
#define zpl_dir_emit_dotdot dir_emit_dotdot
|
||||
#define zpl_dir_emit_dots dir_emit_dots
|
||||
|
||||
#else
|
||||
|
||||
typedef struct zpl_dir_context {
|
||||
void *dirent;
|
||||
const filldir_t actor;
|
||||
loff_t pos;
|
||||
} zpl_dir_context_t;
|
||||
|
||||
#define ZPL_DIR_CONTEXT_INIT(_dirent, _actor, _pos) { \
|
||||
.dirent = _dirent, \
|
||||
.actor = _actor, \
|
||||
.pos = _pos, \
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit(zpl_dir_context_t *ctx, const char *name, int namelen,
|
||||
uint64_t ino, unsigned type)
|
||||
{
|
||||
return (!ctx->actor(ctx->dirent, name, namelen, ctx->pos, ino, type));
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit_dot(struct file *file, zpl_dir_context_t *ctx)
|
||||
{
|
||||
return (ctx->actor(ctx->dirent, ".", 1, ctx->pos,
|
||||
file_inode(file)->i_ino, DT_DIR) == 0);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit_dotdot(struct file *file, zpl_dir_context_t *ctx)
|
||||
{
|
||||
return (ctx->actor(ctx->dirent, "..", 2, ctx->pos,
|
||||
parent_ino(file_dentry(file)), DT_DIR) == 0);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
zpl_dir_emit_dots(struct file *file, zpl_dir_context_t *ctx)
|
||||
{
|
||||
if (ctx->pos == 0) {
|
||||
if (!zpl_dir_emit_dot(file, ctx))
|
||||
return (false);
|
||||
ctx->pos = 1;
|
||||
}
|
||||
if (ctx->pos == 1) {
|
||||
if (!zpl_dir_emit_dotdot(file, ctx))
|
||||
return (false);
|
||||
ctx->pos = 2;
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
#endif /* HAVE_VFS_ITERATE */
|
||||
|
||||
|
||||
/* zpl_file_range.c */
|
||||
|
||||
/* handlers for file_operations of the same name */
|
||||
|
@ -235,12 +161,9 @@ extern long zpl_ioctl_fideduperange(struct file *filp, void *arg);
|
|||
|
||||
#if defined(HAVE_INODE_TIMESTAMP_TRUNCATE)
|
||||
#define zpl_inode_timestamp_truncate(ts, ip) timestamp_truncate(ts, ip)
|
||||
#elif defined(HAVE_INODE_TIMESPEC64_TIMES)
|
||||
#define zpl_inode_timestamp_truncate(ts, ip) \
|
||||
timespec64_trunc(ts, (ip)->i_sb->s_time_gran)
|
||||
#else
|
||||
#define zpl_inode_timestamp_truncate(ts, ip) \
|
||||
timespec_trunc(ts, (ip)->i_sb->s_time_gran)
|
||||
timespec64_trunc(ts, (ip)->i_sb->s_time_gran)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_INODE_OWNER_OR_CAPABLE)
|
||||
|
|
|
@ -31,10 +31,7 @@
|
|||
#include <linux/mod_compat.h>
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
#ifdef HAVE_SCHED_SIGNAL_HEADER
|
||||
#include <linux/sched/signal.h>
|
||||
#endif
|
||||
|
||||
#define MAX_HRTIMEOUT_SLACK_US 1000
|
||||
static unsigned int spl_schedule_hrtimeout_slack_us = 0;
|
||||
|
@ -209,48 +206,6 @@ __cv_wait_idle(kcondvar_t *cvp, kmutex_t *mp)
|
|||
}
|
||||
EXPORT_SYMBOL(__cv_wait_idle);
|
||||
|
||||
#if defined(HAVE_IO_SCHEDULE_TIMEOUT)
|
||||
#define spl_io_schedule_timeout(t) io_schedule_timeout(t)
|
||||
#else
|
||||
|
||||
struct spl_task_timer {
|
||||
struct timer_list timer;
|
||||
struct task_struct *task;
|
||||
};
|
||||
|
||||
static void
|
||||
__cv_wakeup(spl_timer_list_t t)
|
||||
{
|
||||
struct timer_list *tmr = (struct timer_list *)t;
|
||||
struct spl_task_timer *task_timer = from_timer(task_timer, tmr, timer);
|
||||
|
||||
wake_up_process(task_timer->task);
|
||||
}
|
||||
|
||||
static long
|
||||
spl_io_schedule_timeout(long time_left)
|
||||
{
|
||||
long expire_time = jiffies + time_left;
|
||||
struct spl_task_timer task_timer;
|
||||
struct timer_list *timer = &task_timer.timer;
|
||||
|
||||
task_timer.task = current;
|
||||
|
||||
timer_setup(timer, __cv_wakeup, 0);
|
||||
|
||||
timer->expires = expire_time;
|
||||
add_timer(timer);
|
||||
|
||||
io_schedule();
|
||||
|
||||
del_timer_sync(timer);
|
||||
|
||||
time_left = expire_time - jiffies;
|
||||
|
||||
return (time_left < 0 ? 0 : time_left);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 'expire_time' argument is an absolute wall clock time in jiffies.
|
||||
* Return value is time left (expire_time - now) or -1 if timeout occurred.
|
||||
|
@ -290,7 +245,7 @@ __cv_timedwait_common(kcondvar_t *cvp, kmutex_t *mp, clock_t expire_time,
|
|||
*/
|
||||
mutex_exit(mp);
|
||||
if (io)
|
||||
time_left = spl_io_schedule_timeout(time_left);
|
||||
time_left = io_schedule_timeout(time_left);
|
||||
else
|
||||
time_left = schedule_timeout(time_left);
|
||||
|
||||
|
|
|
@ -74,26 +74,13 @@ crgetngroups(const cred_t *cr)
|
|||
|
||||
gi = cr->group_info;
|
||||
rc = gi->ngroups;
|
||||
#ifndef HAVE_GROUP_INFO_GID
|
||||
/*
|
||||
* For Linux <= 4.8,
|
||||
* crgetgroups will only returns gi->blocks[0], which contains only
|
||||
* the first NGROUPS_PER_BLOCK groups.
|
||||
*/
|
||||
if (rc > NGROUPS_PER_BLOCK) {
|
||||
WARN_ON_ONCE(1);
|
||||
rc = NGROUPS_PER_BLOCK;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return an array of supplemental gids. The returned address is safe
|
||||
* to use as long as the caller has taken a reference with crhold().
|
||||
*
|
||||
* Linux 4.9 API change, group_info changed from 2d array via ->blocks to 1d
|
||||
* array via ->gid.
|
||||
*/
|
||||
gid_t *
|
||||
crgetgroups(const cred_t *cr)
|
||||
|
@ -102,12 +89,8 @@ crgetgroups(const cred_t *cr)
|
|||
gid_t *gids = NULL;
|
||||
|
||||
gi = cr->group_info;
|
||||
#ifdef HAVE_GROUP_INFO_GID
|
||||
gids = KGIDP_TO_SGIDP(gi->gid);
|
||||
#else
|
||||
if (gi->nblocks > 0)
|
||||
gids = KGIDP_TO_SGIDP(gi->blocks[0]);
|
||||
#endif
|
||||
|
||||
return (gids);
|
||||
}
|
||||
|
||||
|
|
|
@ -623,26 +623,6 @@ ddi_copyout(const void *from, void *to, size_t len, int flags)
|
|||
}
|
||||
EXPORT_SYMBOL(ddi_copyout);
|
||||
|
||||
static ssize_t
|
||||
spl_kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
|
||||
{
|
||||
#if defined(HAVE_KERNEL_READ_PPOS)
|
||||
return (kernel_read(file, buf, count, pos));
|
||||
#else
|
||||
mm_segment_t saved_fs;
|
||||
ssize_t ret;
|
||||
|
||||
saved_fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
ret = vfs_read(file, (void __user *)buf, count, pos);
|
||||
|
||||
set_fs(saved_fs);
|
||||
|
||||
return (ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
spl_getattr(struct file *filp, struct kstat *stat)
|
||||
{
|
||||
|
@ -651,16 +631,8 @@ spl_getattr(struct file *filp, struct kstat *stat)
|
|||
ASSERT(filp);
|
||||
ASSERT(stat);
|
||||
|
||||
#if defined(HAVE_4ARGS_VFS_GETATTR)
|
||||
rc = vfs_getattr(&filp->f_path, stat, STATX_BASIC_STATS,
|
||||
AT_STATX_SYNC_AS_STAT);
|
||||
#elif defined(HAVE_2ARGS_VFS_GETATTR)
|
||||
rc = vfs_getattr(&filp->f_path, stat);
|
||||
#elif defined(HAVE_3ARGS_VFS_GETATTR)
|
||||
rc = vfs_getattr(filp->f_path.mnt, filp->f_dentry, stat);
|
||||
#else
|
||||
#error "No available vfs_getattr()"
|
||||
#endif
|
||||
if (rc)
|
||||
return (-rc);
|
||||
|
||||
|
@ -738,7 +710,7 @@ hostid_read(uint32_t *hostid)
|
|||
* Read directly into the variable like eglibc does.
|
||||
* Short reads are okay; native behavior is preserved.
|
||||
*/
|
||||
error = spl_kernel_read(filp, &value, sizeof (value), &off);
|
||||
error = kernel_read(filp, &value, sizeof (value), &off);
|
||||
if (error < 0) {
|
||||
filp_close(filp, 0);
|
||||
return (EIO);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue