diff options
author | Brian Behlendorf <[email protected]> | 2019-11-12 08:59:06 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-12 08:59:06 -0800 |
commit | 066e825221012e1e81ccf46b0448772bdd7e5483 (patch) | |
tree | 7e071cb3446bccc4ae45c7db7aa5f84cc4a9c8c2 /config | |
parent | 035ebb365383dcca71c4c542093ea1ad2b8e1dea (diff) |
Linux compat: Minimum kernel version 3.10
Increase the minimum supported kernel version from 2.6.32 to 3.10.
This removes support for the following Linux enterprise distributions.
Distribution | Kernel | End of Life
---------------- | ------ | -------------
Ubuntu 12.04 LTS | 3.2 | Apr 28, 2017
SLES 11 | 3.0 | Mar 32, 2019
RHEL / CentOS 6 | 2.6.32 | Nov 30, 2020
The following changes were made as part of removing support.
* Updated `configure` to enforce a minimum kernel version as
specified in the META file (Linux-Minimum: 3.10).
configure: error:
*** Cannot build against kernel version 2.6.32.
*** The minimum supported kernel version is 3.10.
* Removed all `configure` kABI checks and matching C code for
interfaces which solely predate the Linux 3.10 kernel.
* Updated all `configure` kABI checks to fail when an interface is
missing which was in the 3.10 kernel up to the latest 5.1 kernel.
Removed the HAVE_* preprocessor defines for these checks and
updated the code to unconditionally use the verified interface.
* Inverted the detection logic in several kABI checks to match
the new interface as it appears in 3.10 and newer and not the
legacy interface.
* Consolidated the following checks in to individual files. Due
the large number of changes in the checks it made sense to handle
this now. It would be desirable to group other related checks in
the same fashion, but this as left as future work.
- config/kernel-blkdev.m4 - Block device kABI checks
- config/kernel-blk-queue.m4 - Block queue kABI checks
- config/kernel-bio.m4 - Bio interface kABI checks
* Removed the kABI checks for sops->nr_cached_objects() and
sops->free_cached_objects(). These interfaces are currently unused.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #9566
Diffstat (limited to 'config')
70 files changed, 1054 insertions, 1788 deletions
diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4 index 68a72872d..0f1c24656 100644 --- a/config/kernel-acl.m4 +++ b/config/kernel-acl.m4 @@ -66,11 +66,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [ dnl # dnl # 3.1 API change, -dnl # posix_acl_chmod_masq() is not exported anymore and posix_acl_chmod() -dnl # was introduced to replace it. +dnl # posix_acl_chmod() was added as the preferred interface. dnl # dnl # 3.14 API change, -dnl # posix_acl_chmod() is changed to __posix_acl_chmod() +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], [ @@ -89,14 +88,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [ ]) 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) @@ -104,12 +95,21 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [ [__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* +dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [ ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [ @@ -117,7 +117,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [ #include <linux/posix_acl.h> ],[ umode_t tmp; - posix_acl_equiv_mode(NULL,&tmp); + posix_acl_equiv_mode(NULL, &tmp); ]) ]) @@ -125,10 +125,8 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [ AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t]) ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1, - [posix_acl_equiv_mode wants umode_t*]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([posix_acl_equiv_mode()]) ]) ]) @@ -161,123 +159,6 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [ ]) dnl # -dnl # 2.6.27 API change, -dnl # Check if inode_operations contains the function permission -dnl # and expects the nameidata structure to have been removed. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION], [ - ZFS_LINUX_TEST_SRC([inode_operations_permission], [ - #include <linux/fs.h> - - int permission_fn(struct inode *inode, int mask) { return 0; } - - static const struct inode_operations - iops __attribute__ ((unused)) = { - .permission = permission_fn, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [ - AC_MSG_CHECKING([whether iops->permission() exists]) - ZFS_LINUX_TEST_RESULT([inode_operations_permission], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # 2.6.26 API change, -dnl # Check if inode_operations contains the function permission -dnl # and expects the nameidata structure to be passed. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [ - ZFS_LINUX_TEST_SRC([inode_operations_permission_with_nameidata], [ - #include <linux/fs.h> - #include <linux/sched.h> - - int permission_fn(struct inode *inode, int mask, - struct nameidata *nd) { return 0; } - - static const struct inode_operations - iops __attribute__ ((unused)) = { - .permission = permission_fn, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [ - AC_MSG_CHECKING([whether iops->permission() wants nameidata]) - ZFS_LINUX_TEST_RESULT([inode_operations_permission_with_nameidata], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists]) - AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1, - [iops->permission() with nameidata exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # 2.6.32 API change, -dnl # Check if inode_operations contains the function check_acl -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL], [ - ZFS_LINUX_TEST_SRC([inode_operations_check_acl], [ - #include <linux/fs.h> - - int check_acl_fn(struct inode *inode, int mask) { return 0; } - - static const struct inode_operations - iops __attribute__ ((unused)) = { - .check_acl = check_acl_fn, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [ - AC_MSG_CHECKING([whether iops->check_acl() exists]) - ZFS_LINUX_TEST_RESULT([inode_operations_check_acl], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # 2.6.38 API change, -dnl # The function check_acl gained a new parameter: flags -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [ - ZFS_LINUX_TEST_SRC([inode_operations_check_acl_with_flags], [ - #include <linux/fs.h> - - int check_acl_fn(struct inode *inode, int mask, - unsigned int flags) { return 0; } - - static const struct inode_operations - iops __attribute__ ((unused)) = { - .check_acl = check_acl_fn, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [ - AC_MSG_CHECKING([whether iops->check_acl() wants flags]) - ZFS_LINUX_TEST_RESULT([inode_operations_check_acl_with_flags], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists]) - AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1, - [iops->check_acl() wants flags]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # dnl # 3.1 API change, dnl # Check if inode_operations contains the function get_acl dnl # @@ -299,9 +180,8 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [ AC_MSG_CHECKING([whether iops->get_acl() exists]) ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([iops->get_acl()]) ]) ]) @@ -390,10 +270,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [ 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_PERMISSION - ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA - ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL - ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE @@ -406,10 +282,6 @@ AC_DEFUN([ZFS_AC_KERNEL_ACL], [ 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_PERMISSION - ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA - ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL - ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE diff --git a/config/kernel-automount.m4 b/config/kernel-automount.m4 index 93e14fa8d..f7bb63c68 100644 --- a/config/kernel-automount.m4 +++ b/config/kernel-automount.m4 @@ -12,15 +12,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [ struct dentry_operations dops __attribute__ ((unused)) = { .d_automount = d_automount, }; - ],[]) + ]) ]) AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [ AC_MSG_CHECKING([whether dops->d_automount() exists]) ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_AUTOMOUNT, 1, [dops->automount() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([dops->d_automount()]) ]) ]) diff --git a/config/kernel-bdev-logical-size.m4 b/config/kernel-bdev-logical-size.m4 deleted file mode 100644 index 0de9afd88..000000000 --- a/config/kernel-bdev-logical-size.m4 +++ /dev/null @@ -1,26 +0,0 @@ -dnl # -dnl # 2.6.30 API change -dnl # bdev_hardsect_size() replaced with bdev_logical_block_size(). While -dnl # it has been true for a while that there was no strict 1:1 mapping -dnl # between physical sector size and logical block size this change makes -dnl # it explicit. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_LOGICAL_BLOCK_SIZE], [ - ZFS_LINUX_TEST_SRC([bdev_logical_block_size], [ - #include <linux/blkdev.h> - ],[ - struct block_device *bdev = NULL; - bdev_logical_block_size(bdev); - ], [$NO_UNUSED_BUT_SET_VARIABLE]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE], [ - AC_MSG_CHECKING([whether bdev_logical_block_size() is available]) - ZFS_LINUX_TEST_RESULT([bdev_logical_block_size], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BDEV_LOGICAL_BLOCK_SIZE, 1, - [bdev_logical_block_size() is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-bdev-physical-size.m4 b/config/kernel-bdev-physical-size.m4 deleted file mode 100644 index 94d8172d3..000000000 --- a/config/kernel-bdev-physical-size.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl # -dnl # 2.6.30 API change -dnl # -dnl # The bdev_physical_block_size() interface was added to provide a way -dnl # to determine the smallest write which can be performed without a -dnl # read-modify-write operation. From the kernel documentation: -dnl # -dnl # What: /sys/block/<disk>/queue/physical_block_size -dnl # Date: May 2009 -dnl # Contact: Martin K. Petersen <[email protected]> -dnl # Description: -dnl # This is the smallest unit the storage device can write -dnl # without resorting to read-modify-write operation. It is -dnl # usually the same as the logical block size but may be -dnl # bigger. One example is SATA drives with 4KB sectors -dnl # that expose a 512-byte logical block size to the -dnl # operating system. -dnl # -dnl # Unfortunately, this interface isn't entirely reliable because -dnl # drives are sometimes known to misreport this value. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_PHYSICAL_BLOCK_SIZE], [ - ZFS_LINUX_TEST_SRC([bdev_physical_block_size], [ - #include <linux/blkdev.h> - ],[ - struct block_device *bdev = NULL; - bdev_physical_block_size(bdev); - ], [$NO_UNUSED_BUT_SET_VARIABLE]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE], [ - AC_MSG_CHECKING([whether bdev_physical_block_size() is available]) - ZFS_LINUX_TEST_RESULT([bdev_physical_block_size], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BDEV_PHYSICAL_BLOCK_SIZE, 1, - [bdev_physical_block_size() is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-bdi.m4 b/config/kernel-bdi.m4 index 51516332a..9351df71b 100644 --- a/config/kernel-bdi.m4 +++ b/config/kernel-bdi.m4 @@ -72,11 +72,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDI], [ AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1, [bdi_setup_and_register() wants 3 args]) ], [ - dnl # - dnl # 2.6.32 - 2.6.33, bdi_setup_and_register() - dnl # is not exported. - dnl # - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([bdi_setup]) ]) ]) ]) diff --git a/config/kernel-bio-bvec-iter.m4 b/config/kernel-bio-bvec-iter.m4 deleted file mode 100644 index f9a99cee6..000000000 --- a/config/kernel-bio-bvec-iter.m4 +++ /dev/null @@ -1,23 +0,0 @@ -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) - ]) -]) diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4 deleted file mode 100644 index 80a1fbeda..000000000 --- a/config/kernel-bio-end-io-t-args.m4 +++ /dev/null @@ -1,50 +0,0 @@ -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> - 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) - ]) -]) diff --git a/config/kernel-bio-failfast.m4 b/config/kernel-bio-failfast.m4 deleted file mode 100644 index 0c636f08c..000000000 --- a/config/kernel-bio-failfast.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl # -dnl # Preferred interface for setting FAILFAST on a bio: -dnl # 2.6.28-2.6.35: BIO_RW_FAILFAST_{DEV|TRANSPORT|DRIVER} -dnl # >= 2.6.36: REQ_FAILFAST_{DEV|TRANSPORT|DRIVER} -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_FAILFAST_DTD], [ - ZFS_LINUX_TEST_SRC([bio_failfast_dtd], [ - #include <linux/bio.h> - ],[ - int flags __attribute__ ((unused)); - flags = ((1 << BIO_RW_FAILFAST_DEV) | - (1 << BIO_RW_FAILFAST_TRANSPORT) | - (1 << BIO_RW_FAILFAST_DRIVER)); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST_DTD], [ - AC_MSG_CHECKING([whether BIO_RW_FAILFAST_* are defined]) - ZFS_LINUX_TEST_RESULT([bio_failfast_dtd], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_RW_FAILFAST_DTD, 1, - [BIO_RW_FAILFAST_* are defined]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_REQ_FAILFAST_MASK], [ - ZFS_LINUX_TEST_SRC([bio_failfast_mask], [ - #include <linux/bio.h> - ],[ - int flags __attribute__ ((unused)); - flags = REQ_FAILFAST_MASK; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_REQ_FAILFAST_MASK], [ - AC_MSG_CHECKING([whether REQ_FAILFAST_MASK is defined]) - ZFS_LINUX_TEST_RESULT([bio_failfast_mask], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_REQ_FAILFAST_MASK, 1, - [REQ_FAILFAST_MASK is defined]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_FAILFAST], [ - ZFS_AC_KERNEL_SRC_BIO_FAILFAST_DTD - ZFS_AC_KERNEL_SRC_REQ_FAILFAST_MASK -]) - -AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST], [ - ZFS_AC_KERNEL_BIO_FAILFAST_DTD - ZFS_AC_KERNEL_REQ_FAILFAST_MASK -]) diff --git a/config/kernel-bio-op.m4 b/config/kernel-bio-op.m4 deleted file mode 100644 index 1f2d23791..000000000 --- a/config/kernel-bio-op.m4 +++ /dev/null @@ -1,102 +0,0 @@ -dnl # -dnl # Linux 4.8 API, -dnl # -dnl # The bio_op() helper was introduced as a replacement for explicitly -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> - ],[ - struct bio *bio __attribute__ ((unused)) = NULL; - bio_set_op_attrs(bio, 0, 0); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_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_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_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_HAVE_BIO_SET_OP_ATTRS], [ - AC_MSG_CHECKING([whether bio_set_op_attrs is available]) - ZFS_LINUX_TEST_RESULT([bio_set_op_attrs], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1, - [bio_set_op_attrs is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BIO_OPS], [ - ZFS_AC_KERNEL_REQ_OP_DISCARD - ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE - ZFS_AC_KERNEL_REQ_OP_FLUSH - ZFS_AC_KERNEL_BIO_BI_OPF - ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS -]) diff --git a/config/kernel-bio-rw-barrier.m4 b/config/kernel-bio-rw-barrier.m4 deleted file mode 100644 index f667d4884..000000000 --- a/config/kernel-bio-rw-barrier.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl # -dnl # Interface for issuing a discard bio: -dnl # 2.6.28-2.6.35: BIO_RW_BARRIER -dnl # 2.6.36-3.x: REQ_BARRIER -dnl # -dnl # -dnl # Since REQ_BARRIER is a preprocessor definition, there is no need for an -dnl # autotools check for it. Also, REQ_BARRIER existed in the request layer -dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the -dnl # request layer and bio layer flags, so it would be wrong to assume that -dnl # the APIs are mutually exclusive contrary to the typical case. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_RW_BARRIER], [ - ZFS_LINUX_TEST_SRC([bio_rw_barrier], [ - #include <linux/bio.h> - ],[ - int flags __attribute__ ((unused)); - flags = BIO_RW_BARRIER; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_BARRIER], [ - AC_MSG_CHECKING([whether BIO_RW_BARRIER is defined]) - ZFS_LINUX_TEST_RESULT([bio_rw_barrier], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_RW_BARRIER, 1, [BIO_RW_BARRIER is defined]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-bio-rw-discard.m4 b/config/kernel-bio-rw-discard.m4 deleted file mode 100644 index 34a89279c..000000000 --- a/config/kernel-bio-rw-discard.m4 +++ /dev/null @@ -1,30 +0,0 @@ -dnl # -dnl # Interface for issuing a discard bio: -dnl # 2.6.28-2.6.35: BIO_RW_DISCARD -dnl # 2.6.36-3.x: REQ_DISCARD -dnl # -dnl # -dnl # Since REQ_DISCARD is a preprocessor definition, there is no need for an -dnl # autotools check for it. Also, REQ_DISCARD existed in the request layer -dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the -dnl # request layer and bio layer flags, so it would be wrong to assume that -dnl # the APIs are mutually exclusive contrary to the typical case. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_RW_DISCARD], [ - ZFS_LINUX_TEST_SRC([bio_rw_discard], [ - #include <linux/bio.h> - ],[ - int flags __attribute__ ((unused)); - flags = BIO_RW_DISCARD; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_DISCARD], [ - AC_MSG_CHECKING([whether BIO_RW_DISCARD is defined]) - ZFS_LINUX_TEST_RESULT([bio_rw_discard], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_RW_DISCARD, 1, [BIO_RW_DISCARD is defined]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-bio.m4 b/config/kernel-bio.m4 new file mode 100644 index 000000000..75a4a6de4 --- /dev/null +++ b/config/kernel-bio.m4 @@ -0,0 +1,363 @@ +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 # +dnl # The bio_op() helper was introduced as a replacement for explicitly +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> + ],[ + struct bio *bio __attribute__ ((unused)) = NULL; + bio_set_op_attrs(bio, 0, 0); + ]) +]) + +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], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1, + [bio_set_op_attrs is available]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + +dnl # +dnl # Linux 4.14 API, +dnl # +dnl # The bio_set_dev() helper macro was introduced as part of the transition +dnl # to have struct gendisk in struct bio. +dnl # +dnl # Linux 5.0 API, +dnl # +dnl # The bio_set_dev() helper macro was updated to internally depend on +dnl # bio_associate_blkg() symbol which is exported GPL-only. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [ + ZFS_LINUX_TEST_SRC([bio_set_dev], [ + #include <linux/bio.h> + #include <linux/fs.h> + ],[ + struct block_device *bdev = NULL; + struct bio *bio = NULL; + bio_set_dev(bio, bdev); + ], [], [$ZFS_META_LICENSE]) +]) + +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_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> + 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) + ]) +]) + +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> + ],[ + blk_qc_t blk_qc; + struct bio *bio = NULL; + blk_qc = 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_RESULT(yes) + AC_DEFINE(HAVE_1ARG_SUBMIT_BIO, 1, [submit_bio() wants 1 arg]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + +dnl # +dnl # 2.6.34 API change +dnl # current->bio_list +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_CURRENT_BIO_LIST], [ + ZFS_LINUX_TEST_SRC([current_bio_list], [ + #include <linux/sched.h> + ], [ + current->bio_list = (struct bio_list *) NULL; + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BIO_CURRENT_BIO_LIST], [ + AC_MSG_CHECKING([whether current->bio_list exists]) + ZFS_LINUX_TEST_RESULT([current_bio_list], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([bio_list]) + ]) +]) + +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 +]) + +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 +]) diff --git a/config/kernel-bio_set_dev.m4 b/config/kernel-bio_set_dev.m4 deleted file mode 100644 index b8e13f35a..000000000 --- a/config/kernel-bio_set_dev.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl # -dnl # Linux 4.14 API, -dnl # -dnl # The bio_set_dev() helper macro was introduced as part of the transition -dnl # to have struct gendisk in struct bio. -dnl # -dnl # Linux 5.0 API, -dnl # -dnl # The bio_set_dev() helper macro was updated to internally depend on -dnl # bio_associate_blkg() symbol which is exported GPL-only. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [ - ZFS_LINUX_TEST_SRC([bio_set_dev], [ - #include <linux/bio.h> - #include <linux/fs.h> - ],[ - struct block_device *bdev = NULL; - struct bio *bio = NULL; - bio_set_dev(bio, bdev); - ], [], [$ZFS_META_LICENSE]) -]) - -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_RESULT(no) - ]) -]) diff --git a/config/kernel-blk-queue-bdi.m4 b/config/kernel-blk-queue-bdi.m4 deleted file mode 100644 index 28241c494..000000000 --- a/config/kernel-blk-queue-bdi.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl # -dnl # 2.6.32 - 4.11, statically allocated bdi in request_queue -dnl # 4.12 - x.y, dynamically allocated bdi in request_queue -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI], [ - ZFS_LINUX_TEST_SRC([blk_queue_bdi], [ - #include <linux/blkdev.h> - ],[ - struct request_queue q; - struct backing_dev_info bdi; - q.backing_dev_info = &bdi; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_BDI], [ - AC_MSG_CHECKING([whether blk_queue bdi is dynamic]) - ZFS_LINUX_TEST_RESULT([blk_queue_bdi], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_BDI_DYNAMIC, 1, - [blk queue backing_dev_info is dynamic]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-blk-queue-discard.m4 b/config/kernel-blk-queue-discard.m4 deleted file mode 100644 index 85a29356d..000000000 --- a/config/kernel-blk-queue-discard.m4 +++ /dev/null @@ -1,72 +0,0 @@ -dnl # -dnl # 2.6.32 - 4.x API, -dnl # blk_queue_discard() -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD], [ - ZFS_LINUX_TEST_SRC([blk_queue_discard], [ - #include <linux/blkdev.h> - ],[ - struct request_queue *q __attribute__ ((unused)) = NULL; - int value __attribute__ ((unused)); - value = blk_queue_discard(q); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [ - AC_MSG_CHECKING([whether blk_queue_discard() is available]) - ZFS_LINUX_TEST_RESULT([blk_queue_discard], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_DISCARD, 1, - [blk_queue_discard() is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # 4.8 - 4.x API, -dnl # blk_queue_secure_erase() -dnl # -dnl # 2.6.36 - 4.7 API, -dnl # blk_queue_secdiscard() -dnl # -dnl # 2.6.x - 2.6.35 API, -dnl # Unsupported by kernel -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [ - ZFS_LINUX_TEST_SRC([blk_queue_secure_erase], [ - #include <linux/blkdev.h> - ],[ - struct request_queue *q __attribute__ ((unused)) = NULL; - int value __attribute__ ((unused)); - value = blk_queue_secure_erase(q); - ]) - - ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [ - #include <linux/blkdev.h> - ],[ - struct request_queue *q __attribute__ ((unused)) = NULL; - int value __attribute__ ((unused)); - value = blk_queue_secdiscard(q); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [ - AC_MSG_CHECKING([whether blk_queue_secure_erase() is available]) - ZFS_LINUX_TEST_RESULT([blk_queue_secure_erase], [ - AC_MSG_RESULT(yes) - 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]) - ],[ - AC_MSG_RESULT(no) - ]) - ]) -]) diff --git a/config/kernel-blk-queue-flags.m4 b/config/kernel-blk-queue-flags.m4 deleted file mode 100644 index 9d4dfc159..000000000 --- a/config/kernel-blk-queue-flags.m4 +++ /dev/null @@ -1,56 +0,0 @@ -dnl # -dnl # API change -dnl # https://github.com/torvalds/linux/commit/8814ce8 -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) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAGS], [ - ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_SET - ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAG_CLEAR -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLAGS], [ - ZFS_AC_KERNEL_BLK_QUEUE_FLAG_SET - ZFS_AC_KERNEL_BLK_QUEUE_FLAG_CLEAR -]) diff --git a/config/kernel-blk-queue-flush.m4 b/config/kernel-blk-queue-flush.m4 deleted file mode 100644 index b546d9400..000000000 --- a/config/kernel-blk-queue-flush.m4 +++ /dev/null @@ -1,69 +0,0 @@ -dnl # -dnl # 2.6.36 API change -dnl # In 2.6.36 kernels the blk_queue_ordered() interface has been -dnl # replaced by the simpler blk_queue_flush(). However, while the -dnl # old interface was available to all the new one is GPL-only. -dnl # Thus in addition to detecting if this function is available -dnl # we determine if it is GPL-only. If the GPL-only interface is -dnl # there we implement our own compatibility function, otherwise -dnl # we use the function. The hope is that long term this function -dnl # will be opened up. -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 = NULL; - (void) blk_queue_flush(q, REQ_FLUSH); - ], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE]) - - ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [ - #include <linux/kernel.h> - #include <linux/blkdev.h> - ], [ - struct request_queue *q = NULL; - blk_queue_write_cache(q, true, true); - ], [$NO_UNUSED_BUT_SET_VARIABLE], [$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) - ]) -]) diff --git a/config/kernel-blk-queue-max-hw-sectors.m4 b/config/kernel-blk-queue-max-hw-sectors.m4 deleted file mode 100644 index 7387f84de..000000000 --- a/config/kernel-blk-queue-max-hw-sectors.m4 +++ /dev/null @@ -1,23 +0,0 @@ -dnl # -dnl # 2.6.34 API change -dnl # blk_queue_max_hw_sectors() replaces blk_queue_max_sectors(). -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_HW_SECTORS], [ - ZFS_LINUX_TEST_SRC([blk_queue_max_hw_sectors], [ - #include <linux/blkdev.h> - ], [ - struct request_queue *q = NULL; - (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS); - ], [$NO_UNUSED_BUT_SET_VARIABLE]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [ - AC_MSG_CHECKING([whether blk_queue_max_hw_sectors() is available]) - ZFS_LINUX_TEST_RESULT([blk_queue_max_hw_sectors], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_MAX_HW_SECTORS, 1, - [blk_queue_max_hw_sectors() is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-blk-queue-max-segments.m4 b/config/kernel-blk-queue-max-segments.m4 deleted file mode 100644 index 1e4092df9..000000000 --- a/config/kernel-blk-queue-max-segments.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl # -dnl # 2.6.34 API change -dnl # blk_queue_max_segments() consolidates blk_queue_max_hw_segments() -dnl # and blk_queue_max_phys_segments(). -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_SEGMENTS], [ - ZFS_LINUX_TEST_SRC([blk_queue_max_segments], [ - #include <linux/blkdev.h> - ], [ - struct request_queue *q = NULL; - (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS); - ], [$NO_UNUSED_BUT_SET_VARIABLE]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [ - AC_MSG_CHECKING([whether blk_queue_max_segments() is available]) - ZFS_LINUX_TEST_RESULT([blk_queue_max_segments], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_MAX_SEGMENTS, 1, - [blk_queue_max_segments() is available]) - ], [ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-blk-queue-unplug.m4 b/config/kernel-blk-queue-unplug.m4 deleted file mode 100644 index f5d1814b8..000000000 --- a/config/kernel-blk-queue-unplug.m4 +++ /dev/null @@ -1,54 +0,0 @@ -dnl # -dnl # 2.6.32-2.6.35 API - The BIO_RW_UNPLUG enum can be used as a hint -dnl # to unplug the queue. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_RW_UNPLUG], [ - ZFS_LINUX_TEST_SRC([blk_queue_bio_rw_unplug], [ - #include <linux/blkdev.h> - ],[ - enum bio_rw_flags rw __attribute__ ((unused)) = BIO_RW_UNPLUG; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_UNPLUG], [ - AC_MSG_CHECKING([whether the BIO_RW_UNPLUG enum is available]) - ZFS_LINUX_TEST_RESULT([blk_queue_bio_rw_unplug], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG, 1, - [BIO_RW_UNPLUG is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_PLUG], [ - ZFS_LINUX_TEST_SRC([blk_plug], [ - #include <linux/blkdev.h> - ],[ - struct blk_plug plug __attribute__ ((unused)); - - blk_start_plug(&plug); - blk_finish_plug(&plug); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_PLUG], [ - AC_MSG_CHECKING([whether struct blk_plug is available]) - ZFS_LINUX_TEST_RESULT([blk_plug], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLK_QUEUE_HAVE_BLK_PLUG, 1, - [struct blk_plug is available]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_PLUG], [ - ZFS_AC_KERNEL_SRC_BIO_RW_UNPLUG - ZFS_AC_KERNEL_SRC_BLK_PLUG -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_PLUG], [ - ZFS_AC_KERNEL_BIO_RW_UNPLUG - ZFS_AC_KERNEL_BLK_PLUG -]) diff --git a/config/kernel-blk-queue.m4 b/config/kernel-blk-queue.m4 new file mode 100644 index 000000000..382ebefd3 --- /dev/null +++ b/config/kernel-blk-queue.m4 @@ -0,0 +1,302 @@ +dnl # +dnl # 2.6.39 API change, +dnl # blk_start_plug() and blk_finish_plug() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_PLUG], [ + ZFS_LINUX_TEST_SRC([blk_plug], [ + #include <linux/blkdev.h> + ],[ + struct blk_plug plug __attribute__ ((unused)); + + blk_start_plug(&plug); + blk_finish_plug(&plug); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_PLUG], [ + AC_MSG_CHECKING([whether struct blk_plug is available]) + ZFS_LINUX_TEST_RESULT([blk_plug], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([blk_plug]) + ]) +]) + +dnl # +dnl # 2.6.32 - 4.11, statically allocated bdi in request_queue +dnl # 4.12 - x.y, dynamically allocated bdi in request_queue +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI], [ + ZFS_LINUX_TEST_SRC([blk_queue_bdi], [ + #include <linux/blkdev.h> + ],[ + struct request_queue q; + struct backing_dev_info bdi; + q.backing_dev_info = &bdi; + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_BDI], [ + AC_MSG_CHECKING([whether blk_queue bdi is dynamic]) + ZFS_LINUX_TEST_RESULT([blk_queue_bdi], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BLK_QUEUE_BDI_DYNAMIC, 1, + [blk queue backing_dev_info is dynamic]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + +dnl # +dnl # 2.6.32 - 4.x API, +dnl # blk_queue_discard() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD], [ + ZFS_LINUX_TEST_SRC([blk_queue_discard], [ + #include <linux/blkdev.h> + ],[ + struct request_queue *q __attribute__ ((unused)) = NULL; + int value __attribute__ ((unused)); + value = blk_queue_discard(q); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_DISCARD], [ + AC_MSG_CHECKING([whether blk_queue_discard() is available]) + ZFS_LINUX_TEST_RESULT([blk_queue_discard], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([blk_queue_discard]) + ]) +]) + +dnl # +dnl # 4.8 - 4.x API, +dnl # blk_queue_secure_erase() +dnl # +dnl # 2.6.36 - 4.7 API, +dnl # blk_queue_secdiscard() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE], [ + ZFS_LINUX_TEST_SRC([blk_queue_secure_erase], [ + #include <linux/blkdev.h> + ],[ + struct request_queue *q __attribute__ ((unused)) = NULL; + int value __attribute__ ((unused)); + value = blk_queue_secure_erase(q); + ]) + + ZFS_LINUX_TEST_SRC([blk_queue_secdiscard], [ + #include <linux/blkdev.h> + ],[ + struct request_queue *q __attribute__ ((unused)) = NULL; + int value __attribute__ ((unused)); + value = blk_queue_secdiscard(q); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE], [ + AC_MSG_CHECKING([whether blk_queue_secure_erase() is available]) + ZFS_LINUX_TEST_RESULT([blk_queue_secure_erase], [ + AC_MSG_RESULT(yes) + 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]) + ]) + ]) +]) + +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 = NULL; + (void) blk_queue_flush(q, REQ_FLUSH); + ], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE]) + + ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [ + #include <linux/kernel.h> + #include <linux/blkdev.h> + ], [ + struct request_queue *q = NULL; + blk_queue_write_cache(q, true, true); + ], [$NO_UNUSED_BUT_SET_VARIABLE], [$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(). +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_HW_SECTORS], [ + ZFS_LINUX_TEST_SRC([blk_queue_max_hw_sectors], [ + #include <linux/blkdev.h> + ], [ + struct request_queue *q = NULL; + (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS); + ], [$NO_UNUSED_BUT_SET_VARIABLE]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_HW_SECTORS], [ + AC_MSG_CHECKING([whether blk_queue_max_hw_sectors() is available]) + ZFS_LINUX_TEST_RESULT([blk_queue_max_hw_sectors], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([blk_queue_max_hw_sectors]) + ]) +]) + +dnl # +dnl # 2.6.34 API change +dnl # blk_queue_max_segments() consolidates blk_queue_max_hw_segments() +dnl # and blk_queue_max_phys_segments(). +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_MAX_SEGMENTS], [ + ZFS_LINUX_TEST_SRC([blk_queue_max_segments], [ + #include <linux/blkdev.h> + ], [ + struct request_queue *q = NULL; + (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS); + ], [$NO_UNUSED_BUT_SET_VARIABLE]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_MAX_SEGMENTS], [ + AC_MSG_CHECKING([whether blk_queue_max_segments() is available]) + ZFS_LINUX_TEST_RESULT([blk_queue_max_segments], [ + AC_MSG_RESULT(yes) + ], [ + ZFS_LINUX_TEST_ERROR([blk_queue_max_segments]) + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE], [ + ZFS_AC_KERNEL_SRC_BLK_QUEUE_PLUG + ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI + 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 +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE], [ + ZFS_AC_KERNEL_BLK_QUEUE_PLUG + ZFS_AC_KERNEL_BLK_QUEUE_BDI + 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 +]) diff --git a/config/kernel-blkdev-get-by-path.m4 b/config/kernel-blkdev-get-by-path.m4 deleted file mode 100644 index fb0cea6af..000000000 --- a/config/kernel-blkdev-get-by-path.m4 +++ /dev/null @@ -1,24 +0,0 @@ -dnl # -dnl # 2.6.38 API change -dnl # open_bdev_exclusive() changed to blkdev_get_by_path() -dnl # close_bdev_exclusive() changed to blkdev_put() -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH], [ - ZFS_LINUX_TEST_SRC([blkdev_get_by_path], [ - #include <linux/fs.h> - ], [ - blkdev_get_by_path(NULL, 0, NULL); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH], [ - AC_MSG_CHECKING([whether blkdev_get_by_path() is available]) - ZFS_LINUX_TEST_RESULT_SYMBOL([blkdev_get_by_path], - [blkdev_get_by_path], [fs/block_dev.c], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLKDEV_GET_BY_PATH, 1, - [blkdev_get_by_path() is available]) - ], [ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-blkdev-reread-part.m4 b/config/kernel-blkdev-reread-part.m4 deleted file mode 100644 index 1bf1e7c3a..000000000 --- a/config/kernel-blkdev-reread-part.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl # -dnl # 4.1 API, exported blkdev_reread_part() symbol, backported to the -dnl # 3.10.0 CentOS 7.x enterprise kernels. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_REREAD_PART], [ - ZFS_LINUX_TEST_SRC([blkdev_reread_part], [ - #include <linux/fs.h> - ], [ - struct block_device *bdev = NULL; - int error; - - error = blkdev_reread_part(bdev); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_REREAD_PART], [ - AC_MSG_CHECKING([whether blkdev_reread_part() is available]) - ZFS_LINUX_TEST_RESULT([blkdev_reread_part], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLKDEV_REREAD_PART, 1, - [blkdev_reread_part() is available]) - ], [ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-blkdev.m4 b/config/kernel-blkdev.m4 new file mode 100644 index 000000000..e21010654 --- /dev/null +++ b/config/kernel-blkdev.m4 @@ -0,0 +1,207 @@ +dnl # +dnl # 2.6.38 API change, +dnl # Added blkdev_get_by_path() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH], [ + ZFS_LINUX_TEST_SRC([blkdev_get_by_path], [ + #include <linux/fs.h> + ], [ + struct block_device *bdev __attribute__ ((unused)) = NULL; + const char *path = "path"; + fmode_t mode = 0; + void *holder = NULL; + + bdev = blkdev_get_by_path(path, mode, holder); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH], [ + AC_MSG_CHECKING([whether blkdev_get_by_path() exists]) + ZFS_LINUX_TEST_RESULT([blkdev_get_by_path], [ + AC_MSG_RESULT(yes) + ], [ + ZFS_LINUX_TEST_ERROR([blkdev_get_by_path()]) + ]) +]) + +dnl # +dnl # 2.6.38 API change, +dnl # Added blkdev_put() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_PUT], [ + ZFS_LINUX_TEST_SRC([blkdev_put], [ + #include <linux/fs.h> + ], [ + struct block_device *bdev = NULL; + fmode_t mode = 0; + + blkdev_put(bdev, mode); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_PUT], [ + AC_MSG_CHECKING([whether blkdev_put() exists]) + ZFS_LINUX_TEST_RESULT([blkdev_put], [ + AC_MSG_RESULT(yes) + ], [ + ZFS_LINUX_TEST_ERROR([blkdev_put()]) + ]) +]) + +dnl # +dnl # 4.1 API, exported blkdev_reread_part() symbol, back ported to the +dnl # 3.10.0 CentOS 7.x enterprise kernels. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_REREAD_PART], [ + ZFS_LINUX_TEST_SRC([blkdev_reread_part], [ + #include <linux/fs.h> + ], [ + struct block_device *bdev = NULL; + int error; + + error = blkdev_reread_part(bdev); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_REREAD_PART], [ + AC_MSG_CHECKING([whether blkdev_reread_part() exists]) + ZFS_LINUX_TEST_RESULT([blkdev_reread_part], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BLKDEV_REREAD_PART, 1, + [blkdev_reread_part() exists]) + ], [ + AC_MSG_RESULT(no) + ]) +]) + +dnl # +dnl # 2.6.22 API change +dnl # Single argument invalidate_bdev() +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_INVALIDATE_BDEV], [ + ZFS_LINUX_TEST_SRC([invalidate_bdev], [ + #include <linux/buffer_head.h> + ],[ + struct block_device *bdev = NULL; + invalidate_bdev(bdev); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV], [ + AC_MSG_CHECKING([whether invalidate_bdev() exists]) + ZFS_LINUX_TEST_RESULT([invalidate_bdev], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([invalidate_bdev()]) + ]) +]) + +dnl # +dnl # 2.6.27, lookup_bdev() was exported. +dnl # 4.4.0-6.21 - lookup_bdev() takes 2 arguments. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [ + ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [ + #include <linux/fs.h> + ], [ + lookup_bdev(NULL); + ]) + + ZFS_LINUX_TEST_SRC([lookup_bdev_2args], [ + #include <linux/fs.h> + ], [ + lookup_bdev(NULL, FMODE_READ); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [ + AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg]) + ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg], + [lookup_bdev], [fs/block_dev.c], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1, + [lookup_bdev() wants 1 arg]) + ], [ + AC_MSG_RESULT(no) + + AC_MSG_CHECKING([whether lookup_bdev() wants 2 args]) + ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_2args], + [lookup_bdev], [fs/block_dev.c], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_2ARGS_LOOKUP_BDEV, 1, + [lookup_bdev() wants 2 args]) + ], [ + ZFS_LINUX_TEST_ERROR([lookup_bdev()]) + ]) + ]) +]) + +dnl # +dnl # 2.6.30 API change +dnl # +dnl # The bdev_physical_block_size() interface was added to provide a way +dnl # to determine the smallest write which can be performed without a +dnl # read-modify-write operation. +dnl # +dnl # Unfortunately, this interface isn't entirely reliable because +dnl # drives are sometimes known to misreport this value. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE], [ + ZFS_LINUX_TEST_SRC([bdev_physical_block_size], [ + #include <linux/blkdev.h> + ],[ + struct block_device *bdev __attribute__ ((unused)) = NULL; + bdev_physical_block_size(bdev); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE], [ + AC_MSG_CHECKING([whether bdev_physical_block_size() is available]) + ZFS_LINUX_TEST_RESULT([bdev_physical_block_size], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([bdev_physical_block_size()]) + ]) +]) + +dnl # +dnl # 2.6.30 API change +dnl # Added bdev_logical_block_size(). +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE], [ + ZFS_LINUX_TEST_SRC([bdev_logical_block_size], [ + #include <linux/blkdev.h> + ],[ + struct block_device *bdev __attribute__ ((unused)) = NULL; + bdev_logical_block_size(bdev); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE], [ + AC_MSG_CHECKING([whether bdev_logical_block_size() is available]) + ZFS_LINUX_TEST_RESULT([bdev_logical_block_size], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([bdev_logical_block_size()]) + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [ + ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH + ZFS_AC_KERNEL_SRC_BLKDEV_PUT + ZFS_AC_KERNEL_SRC_BLKDEV_REREAD_PART + ZFS_AC_KERNEL_SRC_BLKDEV_INVALIDATE_BDEV + ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV + ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE + ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE +]) + +AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [ + ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH + ZFS_AC_KERNEL_BLKDEV_PUT + ZFS_AC_KERNEL_BLKDEV_REREAD_PART + ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV + ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV + ZFS_AC_KERNEL_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE + ZFS_AC_KERNEL_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE +]) diff --git a/config/kernel-block-device-operations.m4 b/config/kernel-block-device-operations.m4 index c3d5eec52..8e64ecca9 100644 --- a/config/kernel-block-device-operations.m4 +++ b/config/kernel-block-device-operations.m4 @@ -19,10 +19,8 @@ AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS], [ AC_MSG_CHECKING([whether bops->check_events() exists]) ZFS_LINUX_TEST_RESULT([block_device_operations_check_events], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_CHECK_EVENTS, 1, - [bops->check_events() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([bops->check_events()]) ]) ]) @@ -49,10 +47,8 @@ AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [ AC_MSG_CHECKING([whether bops->release() is void]) ZFS_LINUX_TEST_RESULT([block_device_operations_release_void], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1, - [bops->release() returns void]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([bops->release()]) ]) ]) diff --git a/config/kernel-commit-metadata.m4 b/config/kernel-commit-metadata.m4 index 9bc3b6622..7df9b9802 100644 --- a/config/kernel-commit-metadata.m4 +++ b/config/kernel-commit-metadata.m4 @@ -18,9 +18,7 @@ AC_DEFUN([ZFS_AC_KERNEL_COMMIT_METADATA], [ AC_MSG_CHECKING([whether eops->commit_metadata() exists]) ZFS_LINUX_TEST_RESULT([export_operations_commit_metadata], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_COMMIT_METADATA, 1, - [eops->commit_metadata() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([eops->commit_metadata()]) ]) ]) diff --git a/config/kernel-create-nameidata.m4 b/config/kernel-create-nameidata.m4 deleted file mode 100644 index c43ca5b85..000000000 --- a/config/kernel-create-nameidata.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl # -dnl # 3.6 API change -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE_NAMEIDATA], [ - ZFS_LINUX_TEST_SRC([create_nameidata], [ - #include <linux/fs.h> - #include <linux/sched.h> - - #ifdef HAVE_MKDIR_UMODE_T - int inode_create(struct inode *inode ,struct dentry *dentry, - umode_t umode, struct nameidata *nidata) { return 0; } - #else - int inode_create(struct inode *inode,struct dentry *dentry, - int umode, struct nameidata * nidata) { return 0; } - #endif - - static const struct inode_operations - iops __attribute__ ((unused)) = { - .create = inode_create, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [ - AC_MSG_CHECKING([whether iops->create() passes nameidata]) - ZFS_LINUX_TEST_RESULT([create_nameidata], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1, - [iops->create() passes nameidata]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-ctl-table-name.m4 b/config/kernel-ctl-table-name.m4 deleted file mode 100644 index 16f2ad544..000000000 --- a/config/kernel-ctl-table-name.m4 +++ /dev/null @@ -1,22 +0,0 @@ -dnl # -dnl # 2.6.33 API change, -dnl # Removed .ctl_name from struct ctl_table. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_CTL_NAME], [ - ZFS_LINUX_TEST_SRC([ctl_name], [ - #include <linux/sysctl.h> - ],[ - struct ctl_table ctl __attribute__ ((unused)); - ctl.ctl_name = 0; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_CTL_NAME], [ - AC_MSG_CHECKING([whether struct ctl_table has ctl_name]) - ZFS_LINUX_TEST_RESULT([ctl_name], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CTL_NAME, 1, [struct ctl_table has ctl_name]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-current_bio_tail.m4 b/config/kernel-current_bio_tail.m4 deleted file mode 100644 index 9dfc3e6e0..000000000 --- a/config/kernel-current_bio_tail.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl # -dnl # 2.6.34 API change -dnl # current->bio_tail and current->bio_list were struct bio pointers prior to -dnl # Linux 2.6.34. They were refactored into a struct bio_list pointer called -dnl # current->bio_list in Linux 2.6.34. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_CURRENT_BIO_TAIL], [ - ZFS_LINUX_TEST_SRC([current_bio_tail], [ - #include <linux/sched.h> - ], [ - current->bio_tail = (struct bio **) NULL; - ]) - - ZFS_LINUX_TEST_SRC([current_bio_list], [ - #include <linux/sched.h> - ], [ - current->bio_list = (struct bio_list *) NULL; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_CURRENT_BIO_TAIL], [ - AC_MSG_CHECKING([whether current->bio_tail exists]) - ZFS_LINUX_TEST_RESULT([current_bio_tail], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CURRENT_BIO_TAIL, 1, - [current->bio_tail exists]) - ],[ - AC_MSG_RESULT(no) - - AC_MSG_CHECKING([whether current->bio_list exists]) - ZFS_LINUX_TEST_RESULT([current_bio_list], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CURRENT_BIO_LIST, 1, - [current->bio_list exists]) - ],[ - ZFS_LINUX_TEST_ERROR([bio_list]) - ]) - ]) -]) diff --git a/config/kernel-dentry-operations.m4 b/config/kernel-dentry-operations.m4 index de7482801..660d6260b 100644 --- a/config/kernel-dentry-operations.m4 +++ b/config/kernel-dentry-operations.m4 @@ -38,10 +38,8 @@ AC_DEFUN([ZFS_AC_KERNEL_D_OBTAIN_ALIAS], [ ZFS_LINUX_TEST_RESULT_SYMBOL([d_obtain_alias], [d_obtain_alias], [fs/dcache.c], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_D_OBTAIN_ALIAS, 1, - [d_obtain_alias() is available]) ], [ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([d_obtain_alias()]) ]) ]) @@ -66,7 +64,7 @@ AC_DEFUN([ZFS_AC_KERNEL_D_PRUNE_ALIASES], [ AC_DEFINE(HAVE_D_PRUNE_ALIASES, 1, [d_prune_aliases() is available]) ], [ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([d_prune_aliases()]) ]) ]) @@ -87,9 +85,8 @@ AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [ ZFS_LINUX_TEST_RESULT_SYMBOL([d_set_d_op], [d_set_d_op], [fs/dcache.c], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_D_SET_D_OP, 1, [d_set_d_op() is available]) ], [ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([d_set_d_op]) ]) ]) @@ -146,7 +143,7 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_DENTRY_OPERATIONS], [ AC_DEFINE(HAVE_CONST_DENTRY_OPERATIONS, 1, [dentry uses const struct dentry_operations]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([const dentry_operations]) ]) ]) diff --git a/config/kernel-discard-granularity.m4 b/config/kernel-discard-granularity.m4 index c830d9aa9..61326e677 100644 --- a/config/kernel-discard-granularity.m4 +++ b/config/kernel-discard-granularity.m4 @@ -15,9 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_DISCARD_GRANULARITY], [ AC_MSG_CHECKING([whether ql->discard_granularity is available]) ZFS_LINUX_TEST_RESULT([discard_granularity], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_DISCARD_GRANULARITY, 1, - [ql->discard_granularity is available]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([ql->discard_granularity]) ]) ]) diff --git a/config/kernel-evict-inode.m4 b/config/kernel-evict-inode.m4 index cd91c6669..66f10492d 100644 --- a/config/kernel-evict-inode.m4 +++ b/config/kernel-evict-inode.m4 @@ -19,6 +19,6 @@ AC_DEFUN([ZFS_AC_KERNEL_EVICT_INODE], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_EVICT_INODE, 1, [sops->evict_inode() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([evict_inode]) ]) ]) diff --git a/config/kernel-fallocate.m4 b/config/kernel-fallocate.m4 index 302957a6c..7a8550f7e 100644 --- a/config/kernel-fallocate.m4 +++ b/config/kernel-fallocate.m4 @@ -1,10 +1,9 @@ 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 # AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [ - - dnl # Linux 2.6.38 - 3.x API ZFS_LINUX_TEST_SRC([file_fallocate], [ #include <linux/fs.h> @@ -16,35 +15,13 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FALLOCATE], [ .fallocate = test_fallocate, }; ], []) - - dnl # Linux 2.6.x - 2.6.37 API - ZFS_LINUX_TEST_SRC([inode_fallocate], [ - #include <linux/fs.h> - - long test_fallocate(struct inode *inode, int mode, - loff_t offset, loff_t len) { return 0; } - - static const struct inode_operations - fops __attribute__ ((unused)) = { - .fallocate = test_fallocate, - }; - ], []) ]) AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [ AC_MSG_CHECKING([whether fops->fallocate() exists]) ZFS_LINUX_TEST_RESULT([file_fallocate], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists]) - ],[ - AC_MSG_RESULT(no) - ]) - - AC_MSG_CHECKING([whether iops->fallocate() exists]) - ZFS_LINUX_TEST_RESULT([inode_fallocate], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([file_fallocate]) ]) ]) diff --git a/config/kernel-fmode-t.m4 b/config/kernel-fmode-t.m4 index bc0001b9e..5f111e21b 100644 --- a/config/kernel-fmode-t.m4 +++ b/config/kernel-fmode-t.m4 @@ -14,8 +14,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FMODE_T], [ AC_MSG_CHECKING([whether kernel defines fmode_t]) ZFS_LINUX_TEST_RESULT([type_fmode_t], [ AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FMODE_T, 1, [kernel defines fmode_t]) ],[ - AC_MSG_RESULT([no]) + ZFS_LINUX_TEST_ERROR([type_fmode_t]) ]) ]) diff --git a/config/kernel-follow-down-one.m4 b/config/kernel-follow-down-one.m4 index 94e4aeb8d..38c460d35 100644 --- a/config/kernel-follow-down-one.m4 +++ b/config/kernel-follow-down-one.m4 @@ -16,9 +16,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_DOWN_ONE], [ AC_MSG_CHECKING([whether follow_down_one() is available]) ZFS_LINUX_TEST_RESULT([follow_down_one], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FOLLOW_DOWN_ONE, 1, - [follow_down_one() is available]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([follow_down_one()]) ]) ]) diff --git a/config/kernel-fst-mount.m4 b/config/kernel-fst-mount.m4 index cec1ed4d6..576f5f012 100644 --- a/config/kernel-fst-mount.m4 +++ b/config/kernel-fst-mount.m4 @@ -24,8 +24,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FST_MOUNT], [ AC_MSG_CHECKING([whether fst->mount() exists]) ZFS_LINUX_TEST_RESULT([file_system_type_mount], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FST_MOUNT, 1, [fst->mount() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([fst->mount()]) ]) ]) diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4 index 0494e31ad..d198191d3 100644 --- a/config/kernel-fsync.m4 +++ b/config/kernel-fsync.m4 @@ -2,18 +2,6 @@ dnl # dnl # Check file_operations->fsync interface. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [ - ZFS_LINUX_TEST_SRC([fsync_with_dentry], [ - #include <linux/fs.h> - - int test_fsync(struct file *f, struct dentry *dentry, int x) - { return 0; } - - static const struct file_operations - fops __attribute__ ((unused)) = { - .fsync = test_fsync, - }; - ],[]) - ZFS_LINUX_TEST_SRC([fsync_without_dentry], [ #include <linux/fs.h> @@ -40,38 +28,26 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FSYNC], [ AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [ dnl # - dnl # Linux 2.6.x - 2.6.34 API + dnl # Linux 2.6.35 - Linux 3.0 API dnl # - AC_MSG_CHECKING([whether fops->fsync() wants dentry]) - ZFS_LINUX_TEST_RESULT([fsync_with_dentry], [ + AC_MSG_CHECKING([whether fops->fsync() wants no dentry]) + ZFS_LINUX_TEST_RESULT([fsync_without_dentry], [ AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1, - [fops->fsync() with dentry]) + AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1, + [fops->fsync() without dentry]) ],[ AC_MSG_RESULT([no]) dnl # - dnl # Linux 2.6.35 - Linux 3.0 API + dnl # Linux 3.1 - 3.x 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_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]) ],[ - 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]) - ]) + ZFS_LINUX_TEST_ERROR([fops->fsync]) ]) ]) ]) diff --git a/config/kernel-get-disk-ro.m4 b/config/kernel-get-disk-ro.m4 index 1e2abb475..8a379c766 100644 --- a/config/kernel-get-disk-ro.m4 +++ b/config/kernel-get-disk-ro.m4 @@ -14,8 +14,7 @@ AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_RO], [ AC_MSG_CHECKING([whether get_disk_ro() is available]) ZFS_LINUX_TEST_RESULT([get_disk_ro], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_GET_DISK_RO, 1, [blk_disk_ro() is available]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([get_disk_ro()]) ]) ]) diff --git a/config/kernel-inode-create.m4 b/config/kernel-inode-create.m4 new file mode 100644 index 000000000..9f28bcbd4 --- /dev/null +++ b/config/kernel-inode-create.m4 @@ -0,0 +1,26 @@ +dnl # +dnl # 3.6 API change +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_CREATE_FLAGS], [ + ZFS_LINUX_TEST_SRC([create_flags], [ + #include <linux/fs.h> + #include <linux/sched.h> + + int inode_create(struct inode *inode ,struct dentry *dentry, + umode_t umode, bool flag) { return 0; } + + static const struct inode_operations + iops __attribute__ ((unused)) = { + .create = inode_create, + }; + ],[]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_CREATE_FLAGS], [ + AC_MSG_CHECKING([whether iops->create() passes flags]) + ZFS_LINUX_TEST_RESULT([create_flags], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([iops->create()]) + ]) +]) diff --git a/config/kernel-inode-lookup.m4 b/config/kernel-inode-lookup.m4 new file mode 100644 index 000000000..1a56e69b0 --- /dev/null +++ b/config/kernel-inode-lookup.m4 @@ -0,0 +1,26 @@ +dnl # +dnl # 3.6 API change +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS], [ + ZFS_LINUX_TEST_SRC([lookup_flags], [ + #include <linux/fs.h> + #include <linux/sched.h> + + struct dentry *inode_lookup(struct inode *inode, + struct dentry *dentry, unsigned int flags) { return NULL; } + + static const struct inode_operations iops + __attribute__ ((unused)) = { + .lookup = inode_lookup, + }; + ],[]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_FLAGS], [ + AC_MSG_CHECKING([whether iops->lookup() passes flags]) + ZFS_LINUX_TEST_RESULT([lookup_flags], [ + AC_MSG_RESULT(yes) + ],[ + ZFS_LINUX_TEST_ERROR([iops->lookup()]) + ]) +]) diff --git a/config/kernel-insert-inode-locked.m4 b/config/kernel-insert-inode-locked.m4 index 4990399c3..348aff9a5 100644 --- a/config/kernel-insert-inode-locked.m4 +++ b/config/kernel-insert-inode-locked.m4 @@ -15,9 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_INSERT_INODE_LOCKED], [ ZFS_LINUX_TEST_RESULT_SYMBOL([insert_inode_locked], [insert_inode_locked], [fs/inode.c], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INSERT_INODE_LOCKED, 1, - [insert_inode_locked() is available]) ], [ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([insert_inode_locked()]) ]) ]) diff --git a/config/kernel-invalidate-bdev-args.m4 b/config/kernel-invalidate-bdev-args.m4 deleted file mode 100644 index 55a784dd9..000000000 --- a/config/kernel-invalidate-bdev-args.m4 +++ /dev/null @@ -1,23 +0,0 @@ -dnl # -dnl # 2.6.22 API change -dnl # Unused destroy_dirty_buffers arg removed from prototype. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_INVALIDATE_BDEV], [ - ZFS_LINUX_TEST_SRC([invalidate_bdev], [ - #include <linux/buffer_head.h> - ],[ - struct block_device *bdev = NULL; - invalidate_bdev(bdev); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_INVALIDATE_BDEV], [ - AC_MSG_CHECKING([whether invalidate_bdev() wants 1 arg]) - ZFS_LINUX_TEST_RESULT([invalidate_bdev], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_1ARG_INVALIDATE_BDEV, 1, - [invalidate_bdev() wants 1 arg]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-is_owner_or_cap.m4 b/config/kernel-is_owner_or_cap.m4 index ab8072409..3df6163da 100644 --- a/config/kernel-is_owner_or_cap.m4 +++ b/config/kernel-is_owner_or_cap.m4 @@ -11,33 +11,13 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OWNER_OR_CAPABLE], [ struct inode *ip = NULL; (void) inode_owner_or_capable(ip); ]) - - - ZFS_LINUX_TEST_SRC([is_owner_or_cap], [ - #include <linux/fs.h> - #include <linux/sched.h> - ],[ - struct inode *ip = NULL; - (void) is_owner_or_cap(ip); - ]) ]) AC_DEFUN([ZFS_AC_KERNEL_INODE_OWNER_OR_CAPABLE], [ AC_MSG_CHECKING([whether inode_owner_or_capable() exists]) ZFS_LINUX_TEST_RESULT([inode_owner_or_capable], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INODE_OWNER_OR_CAPABLE, 1, - [inode_owner_or_capable() exists]) ],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING([whether is_owner_or_cap() exists]) - - ZFS_LINUX_TEST_RESULT([is_owner_or_cap], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_IS_OWNER_OR_CAP, 1, - [is_owner_or_cap() exists]) - ],[ - ZFS_LINUX_TEST_ERROR([capability]) - ]) + ZFS_LINUX_TEST_ERROR([capability]) ]) ]) diff --git a/config/kernel-kmap-atomic-args.m4 b/config/kernel-kmap-atomic-args.m4 index d09e93d7f..1172505af 100644 --- a/config/kernel-kmap-atomic-args.m4 +++ b/config/kernel-kmap-atomic-args.m4 @@ -16,9 +16,7 @@ AC_DEFUN([ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS], [ AC_MSG_CHECKING([whether kmap_atomic wants 1 args]) ZFS_LINUX_TEST_RESULT([kmap_atomic], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_1ARG_KMAP_ATOMIC, 1, - [kmap_atomic wants 1 args]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([kmap_atomic()]) ]) ]) diff --git a/config/kernel-kmem-cache.m4 b/config/kernel-kmem-cache.m4 index 7576e6cfd..0e9fe9eb2 100644 --- a/config/kernel-kmem-cache.m4 +++ b/config/kernel-kmem-cache.m4 @@ -1,47 +1,4 @@ dnl # -dnl # 2.6.35 API change, -dnl # The cachep->gfpflags member was renamed cachep->allocflags. These are -dnl # private allocation flags which are applied when allocating a new slab -dnl # in kmem_getpages(). Unfortunately there is no public API for setting -dnl # non-default flags. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE_ALLOCFLAGS], [ - ZFS_LINUX_TEST_SRC([kmem_cache_allocflags], [ - #include <linux/slab.h> - ],[ - struct kmem_cache cachep __attribute__ ((unused)); - cachep.allocflags = GFP_KERNEL; - ]) - - ZFS_LINUX_TEST_SRC([kmem_cache_gfpflags], [ - #include <linux/slab.h> - ],[ - struct kmem_cache cachep __attribute__ ((unused)); - cachep.gfpflags = GFP_KERNEL; - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS], [ - AC_MSG_CHECKING([whether struct kmem_cache has allocflags]) - ZFS_LINUX_TEST_RESULT([kmem_cache_allocflags], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KMEM_CACHE_ALLOCFLAGS, 1, - [struct kmem_cache has allocflags]) - ],[ - AC_MSG_RESULT(no) - - AC_MSG_CHECKING([whether struct kmem_cache has gfpflags]) - ZFS_LINUX_TEST_RESULT([kmem_cache_gfpflags], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KMEM_CACHE_GFPFLAGS, 1, - [struct kmem_cache has gfpflags]) - ],[ - AC_MSG_RESULT(no) - ]) - ]) -]) - -dnl # dnl # grsecurity API change, dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by dnl # kmem_cache_create_usercopy(). @@ -76,11 +33,9 @@ AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [ ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_KMEM_CACHE], [ - ZFS_AC_KERNEL_SRC_KMEM_CACHE_ALLOCFLAGS ZFS_AC_KERNEL_SRC_KMEM_CACHE_CREATE_USERCOPY ]) AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE], [ - ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY ]) diff --git a/config/kernel-kstrtoul.m4 b/config/kernel-kstrtoul.m4 index ef3c9843c..8e4b54297 100644 --- a/config/kernel-kstrtoul.m4 +++ b/config/kernel-kstrtoul.m4 @@ -1,8 +1,6 @@ dnl # dnl # 2.6.39 API change -dnl # -dnl # If kstrtoul() doesn't exist, fallback to use strict_strtoul() which has -dnl # existed since 2.6.25. +dnl # Added kstrtoul() dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_KSTRTOUL], [ ZFS_LINUX_TEST_SRC([kstrtoul], [ @@ -18,6 +16,6 @@ AC_DEFUN([ZFS_AC_KERNEL_KSTRTOUL], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_KSTRTOUL, 1, [kstrtoul() exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([kstrtoul()]) ]) ]) diff --git a/config/kernel-kuid-helpers.m4 b/config/kernel-kuid-helpers.m4 index 4bc4e039d..38a439fa6 100644 --- a/config/kernel-kuid-helpers.m4 +++ b/config/kernel-kuid-helpers.m4 @@ -18,9 +18,7 @@ AC_DEFUN([ZFS_AC_KERNEL_KUID_HELPERS], [ AC_MSG_CHECKING([whether i_(uid|gid)_(read|write) exist]) ZFS_LINUX_TEST_RESULT([i_uid_read], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KUID_HELPERS, 1, - [i_(uid|gid)_(read|write) exist]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([i_uid_read]) ]) ]) diff --git a/config/kernel-kuidgid.m4 b/config/kernel-kuidgid.m4 index 15bf98154..b7e441408 100644 --- a/config/kernel-kuidgid.m4 +++ b/config/kernel-kuidgid.m4 @@ -1,34 +1,21 @@ dnl # -dnl # User namespaces, use kuid_t in place of uid_t -dnl # where available. Not strictly a user namespaces thing -dnl # but it should prevent surprises +dnl # 3.8 API change, +dnl # User namespaces, use kuid_t in place of uid_t where available. dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_KUIDGID_T], [ - ZFS_LINUX_TEST_SRC([kuidgid_t_init], [ + ZFS_LINUX_TEST_SRC([kuidgid_t], [ #include <linux/uidgid.h> ], [ kuid_t userid __attribute__ ((unused)) = KUIDT_INIT(0); kgid_t groupid __attribute__ ((unused)) = KGIDT_INIT(0); ]) - - ZFS_LINUX_TEST_SRC([kuidgid_t], [ - #include <linux/uidgid.h> - ], [ - kuid_t userid __attribute__ ((unused)) = 0; - kgid_t groupid __attribute__ ((unused)) = 0; - ]) ]) AC_DEFUN([ZFS_AC_KERNEL_KUIDGID_T], [ AC_MSG_CHECKING([whether kuid_t/kgid_t is available]) - ZFS_LINUX_TEST_RESULT([kuidgid_t_init], [ - ZFS_LINUX_TEST_RESULT([kuidgid_t], [ - AC_MSG_RESULT(yes; optional) - ],[ - AC_MSG_RESULT(yes; mandatory) - AC_DEFINE(HAVE_KUIDGID_T, 1, [kuid_t/kgid_t in use]) - ]) + ZFS_LINUX_TEST_RESULT([kuidgid_t], [ + AC_MSG_RESULT(yes) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([kuid_t/kgid_t]) ]) ]) diff --git a/config/kernel-lookup-bdev.m4 b/config/kernel-lookup-bdev.m4 deleted file mode 100644 index 72b4993e1..000000000 --- a/config/kernel-lookup-bdev.m4 +++ /dev/null @@ -1,39 +0,0 @@ -dnl # -dnl # 2.6.27, lookup_bdev() was exported. -dnl # 4.4.0-6.21 - x.y on Ubuntu, lookup_bdev() takes 2 arguments. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_LOOKUP_BDEV], [ - ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [ - #include <linux/fs.h> - ], [ - lookup_bdev(NULL); - ]) - - ZFS_LINUX_TEST_SRC([lookup_bdev_2args], [ - #include <linux/fs.h> - ], [ - lookup_bdev(NULL, FMODE_READ); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_BDEV], [ - AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg]) - ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg], - [lookup_bdev], [fs/block_dev.c], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1, - [lookup_bdev() wants 1 arg]) - ], [ - AC_MSG_RESULT(no) - - AC_MSG_CHECKING([whether lookup_bdev() wants 2 args]) - ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_2args], - [lookup_bdev], [fs/block_dev.c], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_2ARGS_LOOKUP_BDEV, 1, - [lookup_bdev() wants 2 args]) - ], [ - AC_MSG_RESULT(no) - ]) - ]) -]) diff --git a/config/kernel-lookup-nameidata.m4 b/config/kernel-lookup-nameidata.m4 deleted file mode 100644 index 865b8aff8..000000000 --- a/config/kernel-lookup-nameidata.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl # -dnl # 3.6 API change -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_LOOKUP_NAMEIDATA], [ - ZFS_LINUX_TEST_SRC([lookup_nameidata], [ - #include <linux/fs.h> - #include <linux/sched.h> - - struct dentry *inode_lookup(struct inode *inode, - struct dentry *dentry, struct nameidata *nidata) - { return NULL; } - - static const struct inode_operations iops - __attribute__ ((unused)) = { - .lookup = inode_lookup, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [ - AC_MSG_CHECKING([whether iops->lookup() passes nameidata]) - ZFS_LINUX_TEST_RESULT([lookup_nameidata], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LOOKUP_NAMEIDATA, 1, - [iops->lookup() passes nameidata]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-make-request-fn.m4 b/config/kernel-make-request-fn.m4 index 86339aa04..5183176f5 100644 --- a/config/kernel-make-request-fn.m4 +++ b/config/kernel-make-request-fn.m4 @@ -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_int], [ - #include <linux/blkdev.h> - int make_request(struct request_queue *q, - struct bio *bio) { return (0); } - ],[ - blk_queue_make_request(NULL, &make_request); - ]) - ZFS_LINUX_TEST_SRC([make_request_fn_void], [ #include <linux/blkdev.h> void make_request(struct request_queue *q, @@ -29,49 +21,34 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ dnl # - dnl # Legacy API - dnl # make_request_fn returns int. + dnl # Linux 3.2 API Change + dnl # make_request_fn returns void. dnl # - AC_MSG_CHECKING([whether make_request_fn() returns int]) - ZFS_LINUX_TEST_RESULT([make_request_fn_int], [ + AC_MSG_CHECKING([whether make_request_fn() returns void]) + ZFS_LINUX_TEST_RESULT([make_request_fn_void], [ AC_MSG_RESULT(yes) - AC_DEFINE(MAKE_REQUEST_FN_RET, int, + AC_DEFINE(MAKE_REQUEST_FN_RET, void, [make_request_fn() return type]) - AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_INT, 1, - [Noting that make_request_fn() returns int]) + AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1, + [Noting that make_request_fn() returns void]) ],[ 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], [ + 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, 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]) ]) ]) ]) diff --git a/config/kernel-mkdir-umode-t.m4 b/config/kernel-mkdir-umode-t.m4 index f4dde29a3..19599670d 100644 --- a/config/kernel-mkdir-umode-t.m4 +++ b/config/kernel-mkdir-umode-t.m4 @@ -27,6 +27,6 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [ AC_DEFINE(HAVE_MKDIR_UMODE_T, 1, [iops->create()/mkdir()/mknod() take umode_t]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([mkdir()]) ]) ]) diff --git a/config/kernel-open-bdev-exclusive.m4 b/config/kernel-open-bdev-exclusive.m4 deleted file mode 100644 index 2e46b8876..000000000 --- a/config/kernel-open-bdev-exclusive.m4 +++ /dev/null @@ -1,23 +0,0 @@ -dnl # -dnl # 2.6.28 API change -dnl # open/close_bdev_excl() renamed to open/close_bdev_exclusive() -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_BDEV_OPEN_EXCLUSIVE], [ - ZFS_LINUX_TEST_SRC([open_bdev_exclusive], [ - #include <linux/fs.h> - ], [ - open_bdev_exclusive(NULL, 0, NULL); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_BDEV_OPEN_EXCLUSIVE], [ - AC_MSG_CHECKING([whether open_bdev_exclusive() is available]) - ZFS_LINUX_TEST_RESULT_SYMBOL([open_bdev_exclusive], - [open_bdev_exclusive], [fs/block_dev.c], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_OPEN_BDEV_EXCLUSIVE, 1, - [open_bdev_exclusive() is available]) - ], [ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-pde-data.m4 b/config/kernel-pde-data.m4 index 928c5ef0d..f866d77a1 100644 --- a/config/kernel-pde-data.m4 +++ b/config/kernel-pde-data.m4 @@ -14,8 +14,7 @@ AC_DEFUN([ZFS_AC_KERNEL_PDE_DATA], [ AC_MSG_CHECKING([whether PDE_DATA() is available]) ZFS_LINUX_TEST_RESULT_SYMBOL([pde_data], [PDE_DATA], [], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PDE_DATA, 1, [PDE_DATA is available]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([PDE_DATA]) ]) ]) diff --git a/config/kernel-rwsem.m4 b/config/kernel-rwsem.m4 index 67c5cf908..824f4a3ff 100644 --- a/config/kernel-rwsem.m4 +++ b/config/kernel-rwsem.m4 @@ -19,10 +19,8 @@ AC_DEFUN([ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW], [ AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw]) ZFS_LINUX_TEST_RESULT([rwsem_spinlock_is_raw], [ AC_MSG_RESULT(yes) - AC_DEFINE(RWSEM_SPINLOCK_IS_RAW, 1, - [struct rw_semaphore member wait_lock is raw_spinlock_t]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([rwsem_spinlock_is_raw]) ]) ]) diff --git a/config/kernel-sched.m4 b/config/kernel-sched.m4 index 4a7db970a..17e49fbdf 100644 --- a/config/kernel-sched.m4 +++ b/config/kernel-sched.m4 @@ -14,10 +14,9 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SCHED_RT_HEADER], [ AC_DEFUN([ZFS_AC_KERNEL_SCHED_RT_HEADER], [ AC_MSG_CHECKING([whether header linux/sched/rt.h exists]) ZFS_LINUX_TEST_RESULT([sched_rt_header], [ - AC_DEFINE(HAVE_SCHED_RT_HEADER, 1, [linux/sched/rt.h exists]) AC_MSG_RESULT(yes) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([sched_rt_header]) ]) ]) diff --git a/config/kernel-security-inode-init.m4 b/config/kernel-security-inode-init.m4 index 0dea7e392..4e4bfd29b 100644 --- a/config/kernel-security-inode-init.m4 +++ b/config/kernel-security-inode-init.m4 @@ -1,37 +1,4 @@ dnl # -dnl # 2.6.39 API change -dnl # The security_inode_init_security() function now takes an additional -dnl # qstr argument which must be passed in from the dentry if available. -dnl # Passing a NULL is safe when no qstr is available the relevant -dnl # security checks will just be skipped. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS], [ - ZFS_LINUX_TEST_SRC([security_inode_init_security_6args], [ - #include <linux/security.h> - ],[ - struct inode *ip __attribute__ ((unused)) = NULL; - struct inode *dip __attribute__ ((unused)) = NULL; - const struct qstr *str __attribute__ ((unused)) = NULL; - char *name __attribute__ ((unused)) = NULL; - void *value __attribute__ ((unused)) = NULL; - size_t len __attribute__ ((unused)) = 0; - - security_inode_init_security(ip, dip, str, &name, &value, &len); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS], [ - AC_MSG_CHECKING([whether security_inode_init_security wants 6 args]) - ZFS_LINUX_TEST_RESULT([security_inode_init_security_6args], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1, - [security_inode_init_security wants 6 args]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # dnl # 3.2 API change dnl # The security_inode_init_security() API has been changed to include dnl # a filesystem specific callback to write security extended attributes. @@ -55,19 +22,15 @@ AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK], [ AC_MSG_CHECKING([whether security_inode_init_security wants callback]) ZFS_LINUX_TEST_RESULT([security_inode_init_security], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1, - [security_inode_init_security wants callback]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([security_inode_init_security callback]) ]) ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE], [ - ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK ]) AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE], [ - ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK ]) diff --git a/config/kernel-set-nlink.m4 b/config/kernel-set-nlink.m4 index 63a5a8c0d..fa4f928b2 100644 --- a/config/kernel-set-nlink.m4 +++ b/config/kernel-set-nlink.m4 @@ -1,6 +1,6 @@ dnl # -dnl # Linux v3.2-rc1 API change -dnl # SHA: bfe8684869601dacfcb2cd69ef8cfd9045f62170 +dnl # Linux 3.2 API change +dnl # set_nlink() dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_NLINK], [ ZFS_LINUX_TEST_SRC([set_nlink], [ @@ -16,8 +16,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SET_NLINK], [ AC_MSG_CHECKING([whether set_nlink() is available]) ZFS_LINUX_TEST_RESULT([set_nlink], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SET_NLINK, 1, [set_nlink() is available]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([set_nlink()]) ]) ]) diff --git a/config/kernel-sget-args.m4 b/config/kernel-sget-args.m4 index 13581399e..afa62c797 100644 --- a/config/kernel-sget-args.m4 +++ b/config/kernel-sget-args.m4 @@ -19,8 +19,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SGET], [ AC_MSG_CHECKING([whether sget() wants 5 args]) ZFS_LINUX_TEST_RESULT([sget_5args], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_5ARG_SGET, 1, [sget() wants 5 args]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([sget()]) ]) ]) diff --git a/config/kernel-show-options.m4 b/config/kernel-show-options.m4 index 9e426bc39..93bd5fbfb 100644 --- a/config/kernel-show-options.m4 +++ b/config/kernel-show-options.m4 @@ -19,9 +19,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SHOW_OPTIONS], [ AC_MSG_CHECKING([whether sops->show_options() wants dentry]) ZFS_LINUX_TEST_RESULT([super_operations_show_options], [ AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_SHOW_OPTIONS_WITH_DENTRY, 1, - [sops->show_options() with dentry]) ],[ - AC_MSG_RESULT([no]) + ZFS_LINUX_TEST_ERROR([sops->show_options()]) ]) ]) diff --git a/config/kernel-shrink.m4 b/config/kernel-shrink.m4 index 45b4b5d4b..a40c86d5c 100644 --- a/config/kernel-shrink.m4 +++ b/config/kernel-shrink.m4 @@ -13,7 +13,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_SHRINK], [ static const struct super_block sb __attribute__ ((unused)) = { - .s_shrink.shrink = shrink, .s_shrink.seeks = DEFAULT_SEEKS, .s_shrink.batch = 0, }; @@ -24,101 +23,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK], [ AC_MSG_CHECKING([whether super_block has s_shrink]) ZFS_LINUX_TEST_RESULT([super_block_s_shrink], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -dnl # -dnl # 3.3 API change -dnl # The super_block structure was changed to use an hlist_node instead -dnl # of a list_head for the .s_instance linkage. -dnl # -dnl # This was done in part to resolve a race in the iterate_supers_type() -dnl # function which was introduced in Linux 3.0 kernel. The iterator -dnl # was supposed to provide a safe way to call an arbitrary function on -dnl # all super blocks of a specific type. Unfortunately, because a -dnl # list_head was used it was possible for iterate_supers_type() to -dnl # get stuck spinning a super block which was just deactivated. -dnl # -dnl # This can occur because when the list head is removed from the -dnl # fs_supers list it is reinitialized to point to itself. If the -dnl # iterate_supers_type() function happened to be processing the -dnl # removed list_head it will get stuck spinning on that list_head. -dnl # -dnl # To resolve the issue for existing 3.0 - 3.2 kernels we detect when -dnl # a list_head is used. Then to prevent the spinning from occurring -dnl # the .next pointer is set to the fs_supers list_head which ensures -dnl # the iterate_supers_type() function will always terminate. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_SUPER_BLOCK_S_INSTANCES_LIST_HEAD], [ - ZFS_LINUX_TEST_SRC([super_block_s_instances_list_head], [ - #include <linux/fs.h> - ],[ - struct super_block sb __attribute__ ((unused)); - INIT_LIST_HEAD(&sb.s_instances); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SUPER_BLOCK_S_INSTANCES_LIST_HEAD], [ - AC_MSG_CHECKING([whether super_block has s_instances list_head]) - ZFS_LINUX_TEST_RESULT([super_block_s_instances_list_head], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_S_INSTANCES_LIST_HEAD, 1, - [struct super_block has s_instances list_head]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_NR_CACHED_OBJECTS], [ - ZFS_LINUX_TEST_SRC([nr_cached_objects], [ - #include <linux/fs.h> - - int nr_cached_objects(struct super_block *sb) { return 0; } - - static const struct super_operations - sops __attribute__ ((unused)) = { - .nr_cached_objects = nr_cached_objects, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [ - AC_MSG_CHECKING([whether sops->nr_cached_objects() exists]) - ZFS_LINUX_TEST_RESULT([nr_cached_objects], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1, - [sops->nr_cached_objects() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SRC_FREE_CACHED_OBJECTS], [ - ZFS_LINUX_TEST_SRC([free_cached_objects], [ - #include <linux/fs.h> - - void free_cached_objects(struct super_block *sb, int x) - { return; } - - static const struct super_operations - sops __attribute__ ((unused)) = { - .free_cached_objects = free_cached_objects, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [ - AC_MSG_CHECKING([whether sops->free_cached_objects() exists]) - ZFS_LINUX_TEST_RESULT([free_cached_objects], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1, - [sops->free_cached_objects() exists]) - ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([sb->s_shrink()]) ]) ]) @@ -149,29 +55,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID], [ ]) AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK], [ - ZFS_LINUX_TEST_SRC([shrinker_cb_2arg], [ - #include <linux/mm.h> - int shrinker_cb(int nr_to_scan, gfp_t gfp_mask) { return 0; } - ],[ - struct shrinker cache_shrinker = { - .shrink = shrinker_cb, - .seeks = DEFAULT_SEEKS, - }; - register_shrinker(&cache_shrinker); - ]) - - ZFS_LINUX_TEST_SRC([shrinker_cb_3arg], [ - #include <linux/mm.h> - int shrinker_cb(struct shrinker *shrink, int nr_to_scan, - gfp_t gfp_mask) { return 0; } - ],[ - struct shrinker cache_shrinker = { - .shrink = shrinker_cb, - .seeks = DEFAULT_SEEKS, - }; - register_shrinker(&cache_shrinker); - ]) - ZFS_LINUX_TEST_SRC([shrinker_cb_shrink_control], [ #include <linux/mm.h> int shrinker_cb(struct shrinker *shrink, @@ -200,60 +83,29 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK], [ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER_CALLBACK],[ dnl # - dnl # 2.6.23 to 2.6.34 API change - dnl # ->shrink(int nr_to_scan, gfp_t gfp_mask) + dnl # 3.0 - 3.11 API change + dnl # ->shrink(struct shrinker *, struct shrink_control *sc) dnl # - AC_MSG_CHECKING([whether old 2-argument shrinker exists]) - ZFS_LINUX_TEST_RESULT([shrinker_cb_2arg], [ + AC_MSG_CHECKING([whether new 2-argument shrinker exists]) + ZFS_LINUX_TEST_RESULT([shrinker_cb_shrink_control], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_2ARGS_OLD_SHRINKER_CALLBACK, 1, - [old shrinker callback wants 2 args]) + AC_DEFINE(HAVE_SINGLE_SHRINKER_CALLBACK, 1, + [new shrinker callback wants 2 args]) ],[ AC_MSG_RESULT(no) dnl # - dnl # 2.6.35 - 2.6.39 API change - dnl # ->shrink(struct shrinker *, - dnl # int nr_to_scan, gfp_t gfp_mask) + dnl # 3.12 API change, + dnl # ->shrink() is logically split in to + dnl # ->count_objects() and ->scan_objects() dnl # - AC_MSG_CHECKING([whether old 3-argument shrinker exists]) - ZFS_LINUX_TEST_RESULT([shrinker_cb_3arg], [ + AC_MSG_CHECKING([whether ->count_objects callback exists]) + ZFS_LINUX_TEST_RESULT([shrinker_cb_shrink_control_split], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_3ARGS_SHRINKER_CALLBACK, 1, - [old shrinker callback wants 3 args]) + AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, 1, + [->count_objects exists]) ],[ - AC_MSG_RESULT(no) - - dnl # - dnl # 3.0 - 3.11 API change - dnl # ->shrink(struct shrinker *, - dnl # 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_2ARGS_NEW_SHRINKER_CALLBACK, 1, - [new shrinker callback wants 2 args]) - ],[ - AC_MSG_RESULT(no) - - dnl # - dnl # 3.12 API change, - dnl # ->shrink() is logically split in to - dnl # ->count_objects() and ->scan_objects() - dnl # - AC_MSG_CHECKING( - [whether ->count_objects callback exists]) - ZFS_LINUX_TEST_RESULT( - [shrinker_cb_shrink_control_split], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SPLIT_SHRINKER_CALLBACK, - 1, [->count_objects exists]) - ],[ - ZFS_LINUX_TEST_ERROR([shrinker]) - ]) - ]) + ZFS_LINUX_TEST_ERROR([shrinker]) ]) ]) ]) @@ -280,15 +132,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINK_CONTROL_STRUCT], [ AC_DEFINE(HAVE_SHRINK_CONTROL_STRUCT, 1, [struct shrink_control exists]) ],[ - AC_MSG_RESULT(no) + 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_INSTANCES_LIST_HEAD - ZFS_AC_KERNEL_SRC_NR_CACHED_OBJECTS - ZFS_AC_KERNEL_SRC_FREE_CACHED_OBJECTS ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_HAS_NID ZFS_AC_KERNEL_SRC_SHRINKER_CALLBACK ZFS_AC_KERNEL_SRC_SHRINK_CONTROL_STRUCT @@ -296,9 +145,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SHRINKER], [ AC_DEFUN([ZFS_AC_KERNEL_SHRINKER], [ ZFS_AC_KERNEL_SUPER_BLOCK_S_SHRINK - ZFS_AC_KERNEL_SUPER_BLOCK_S_INSTANCES_LIST_HEAD - ZFS_AC_KERNEL_NR_CACHED_OBJECTS - ZFS_AC_KERNEL_FREE_CACHED_OBJECTS ZFS_AC_KERNEL_SHRINK_CONTROL_HAS_NID ZFS_AC_KERNEL_SHRINKER_CALLBACK ZFS_AC_KERNEL_SHRINK_CONTROL_STRUCT diff --git a/config/kernel-submit_bio.m4 b/config/kernel-submit_bio.m4 deleted file mode 100644 index cf80e9b83..000000000 --- a/config/kernel-submit_bio.m4 +++ /dev/null @@ -1,24 +0,0 @@ -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_SUBMIT_BIO], [ - ZFS_LINUX_TEST_SRC([submit_bio], [ - #include <linux/bio.h> - ],[ - blk_qc_t blk_qc; - struct bio *bio = NULL; - blk_qc = submit_bio(bio); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_SUBMIT_BIO], [ - AC_MSG_CHECKING([whether submit_bio() wants 1 arg]) - ZFS_LINUX_TEST_RESULT([submit_bio], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_1ARG_SUBMIT_BIO, 1, [submit_bio() wants 1 arg]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-truncate-range.m4 b/config/kernel-truncate-range.m4 deleted file mode 100644 index 8fdbb1086..000000000 --- a/config/kernel-truncate-range.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl # -dnl # 3.5.0 API change -dnl # torvalds/linux@17cf28afea2a1112f240a3a2da8af883be024811 removed -dnl # truncate_range(). The file hole punching functionality is now -dnl # provided by fallocate() -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_TRUNCATE_RANGE], [ - ZFS_LINUX_TEST_SRC([inode_operations_truncate_range], [ - #include <linux/fs.h> - void truncate_range(struct inode *inode, loff_t start, - loff_t end) { return; } - static struct inode_operations iops __attribute__ ((unused)) = { - .truncate_range = truncate_range, - }; - ],[]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_TRUNCATE_RANGE], [ - AC_MSG_CHECKING([whether iops->truncate_range() exists]) - ZFS_LINUX_TEST_RESULT([inode_operations_truncate_range], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_INODE_TRUNCATE_RANGE, 1, - [iops->truncate_range() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) diff --git a/config/kernel-truncate-setsize.m4 b/config/kernel-truncate-setsize.m4 index e719c1444..76c82ef30 100644 --- a/config/kernel-truncate-setsize.m4 +++ b/config/kernel-truncate-setsize.m4 @@ -15,9 +15,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TRUNCATE_SETSIZE], [ ZFS_LINUX_TEST_RESULT_SYMBOL([truncate_setsize], [truncate_setsize], [mm/truncate.c], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_TRUNCATE_SETSIZE, 1, - [truncate_setsize() is available]) ], [ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([truncate_setsize]) ]) ]) diff --git a/config/kernel-userns-capabilities.m4 b/config/kernel-userns-capabilities.m4 index 5dcbc03d3..68a7bd62c 100644 --- a/config/kernel-userns-capabilities.m4 +++ b/config/kernel-userns-capabilities.m4 @@ -14,17 +14,14 @@ AC_DEFUN([ZFS_AC_KERNEL_NS_CAPABLE], [ AC_MSG_CHECKING([whether ns_capable exists]) ZFS_LINUX_TEST_RESULT([ns_capable], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_NS_CAPABLE, 1, [ns_capable exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([ns_capable()]) ]) ]) dnl # dnl # 2.6.39 API change -dnl # struct user_namespace was added to struct cred_t as -dnl # cred->user_ns member -dnl # Note that current_user_ns() was added in 2.6.28. +dnl # struct user_namespace was added to struct cred_t as cred->user_ns member dnl # AC_DEFUN([ZFS_AC_KERNEL_SRC_CRED_USER_NS], [ ZFS_LINUX_TEST_SRC([cred_user_ns], [ @@ -39,9 +36,8 @@ AC_DEFUN([ZFS_AC_KERNEL_CRED_USER_NS], [ AC_MSG_CHECKING([whether cred_t->user_ns exists]) ZFS_LINUX_TEST_RESULT([cred_user_ns], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_CRED_USER_NS, 1, [cred_t->user_ns exists]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([cred_t->user_ns()]) ]) ]) @@ -63,10 +59,8 @@ AC_DEFUN([ZFS_AC_KERNEL_KUID_HAS_MAPPING], [ AC_MSG_CHECKING([whether kuid_has_mapping/kgid_has_mapping exist]) ZFS_LINUX_TEST_RESULT([kuid_has_mapping], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KUID_HAS_MAPPING, 1, - [kuid_has_mapping/kgid_has_mapping exist]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([kuid_has_mapping()]) ]) ]) diff --git a/config/kernel-usleep_range.m4 b/config/kernel-usleep_range.m4 index 5bf051ab4..06eb381a3 100644 --- a/config/kernel-usleep_range.m4 +++ b/config/kernel-usleep_range.m4 @@ -17,8 +17,7 @@ AC_DEFUN([ZFS_AC_KERNEL_USLEEP_RANGE], [ AC_MSG_CHECKING([whether usleep_range() is available]) ZFS_LINUX_TEST_RESULT([usleep_range], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_USLEEP_RANGE, 1, [usleep_range is available]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([usleep_range()]) ]) ]) diff --git a/config/kernel-vfs-fsync.m4 b/config/kernel-vfs-fsync.m4 index 18a60d29a..159efca45 100644 --- a/config/kernel-vfs-fsync.m4 +++ b/config/kernel-vfs-fsync.m4 @@ -14,8 +14,7 @@ AC_DEFUN([ZFS_AC_KERNEL_VFS_FSYNC_2ARGS], [ AC_MSG_CHECKING([whether vfs_fsync() wants 2 args]) ZFS_LINUX_TEST_RESULT([vfs_fsync_2args], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_2ARGS_VFS_FSYNC, 1, [vfs_fsync() wants 2 args]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([vfs_fsync()]) ]) ]) diff --git a/config/kernel-xattr-handler.m4 b/config/kernel-xattr-handler.m4 index ed84c6390..137bf4a8a 100644 --- a/config/kernel-xattr-handler.m4 +++ b/config/kernel-xattr-handler.m4 @@ -28,10 +28,8 @@ AC_DEFUN([ZFS_AC_KERNEL_CONST_XATTR_HANDLER], [ AC_MSG_CHECKING([whether super_block uses const struct xattr_handler]) ZFS_LINUX_TEST_RESULT([const_xattr_handler], [ AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_CONST_XATTR_HANDLER, 1, - [super_block uses const struct xattr_handler]) ],[ - AC_MSG_RESULT([no]) + ZFS_LINUX_TEST_ERROR([const xattr_handler]) ]) ]) @@ -102,17 +100,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_GET], [ .get = get, }; ],[]) - - ZFS_LINUX_TEST_SRC([xattr_handler_get_inode], [ - #include <linux/xattr.h> - - int get(struct inode *ip, const char *name, - void *buffer, size_t size) { return 0; } - static const struct xattr_handler - xops __attribute__ ((unused)) = { - .get = get, - }; - ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [ @@ -155,20 +142,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_GET], [ AC_DEFINE(HAVE_XATTR_GET_DENTRY, 1, [xattr_handler->get() wants dentry]) ],[ - dnl # - dnl # Legacy 2.6.32 API - dnl # - AC_MSG_RESULT(no) - AC_MSG_CHECKING( - [whether xattr_handler->get() wants inode]) - ZFS_LINUX_TEST_RESULT( - [xattr_handler_get_inode], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_XATTR_GET_INODE, 1, - [xattr_handler->get() wants inode]) - ],[ - ZFS_LINUX_TEST_ERROR([xattr get()]) - ]) + ZFS_LINUX_TEST_ERROR([xattr get()]) ]) ]) ]) @@ -216,18 +190,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_SET], [ .set = set, }; ],[]) - - ZFS_LINUX_TEST_SRC([xattr_handler_set_inode], [ - #include <linux/xattr.h> - - int set(struct inode *ip, const char *name, - const void *buffer, size_t size, int flags) - { return 0; } - static const struct xattr_handler - xops __attribute__ ((unused)) = { - .set = set, - }; - ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [ @@ -270,20 +232,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_SET], [ AC_DEFINE(HAVE_XATTR_SET_DENTRY, 1, [xattr_handler->set() wants dentry]) ],[ - dnl # - dnl # Legacy 2.6.32 API - dnl # - AC_MSG_RESULT(no) - AC_MSG_CHECKING( - [whether xattr_handler->set() wants inode]) - ZFS_LINUX_TEST_RESULT( - [xattr_handler_set_inode], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_XATTR_SET_INODE, 1, - [xattr_handler->set() wants inode]) - ],[ - ZFS_LINUX_TEST_ERROR([xattr set()]) - ]) + ZFS_LINUX_TEST_ERROR([xattr set()]) ]) ]) ]) @@ -327,18 +276,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_XATTR_HANDLER_LIST], [ .list = list, }; ],[]) - - ZFS_LINUX_TEST_SRC([xattr_handler_list_inode], [ - #include <linux/xattr.h> - - size_t list(struct inode *ip, char *lst, - size_t list_size, const char *name, - size_t name_len) { return 0; } - static const struct xattr_handler - xops __attribute__ ((unused)) = { - .list = list, - }; - ],[]) ]) AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [ @@ -379,20 +316,7 @@ AC_DEFUN([ZFS_AC_KERNEL_XATTR_HANDLER_LIST], [ AC_DEFINE(HAVE_XATTR_LIST_DENTRY, 1, [xattr_handler->list() wants dentry]) ],[ - dnl # - dnl # Legacy 2.6.32 API - dnl # - AC_MSG_RESULT(no) - AC_MSG_CHECKING( - [whether xattr_handler->list() wants inode]) - ZFS_LINUX_TEST_RESULT( - [xattr_handler_list_inode], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_XATTR_LIST_INODE, 1, - [xattr_handler->list() wants inode]) - ],[ - ZFS_LINUX_TEST_ERROR([xattr list()]) - ]) + ZFS_LINUX_TEST_ERROR([xattr list()]) ]) ]) ]) @@ -420,7 +344,7 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_FROM_XATTR_USERNS], [ AC_DEFINE(HAVE_POSIX_ACL_FROM_XATTR_USERNS, 1, [posix_acl_from_xattr() needs user_ns]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([posix_acl_from_xattr()]) ]) ]) diff --git a/config/kernel-zlib.m4 b/config/kernel-zlib.m4 index d554d1168..752d38838 100644 --- a/config/kernel-zlib.m4 +++ b/config/kernel-zlib.m4 @@ -21,6 +21,6 @@ AC_DEFUN([ZFS_AC_KERNEL_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE], [ AC_DEFINE(HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE, 1, [zlib_deflate_workspacesize() wants 2 args]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TEST_ERROR([zlib_deflate_workspacesize()]) ]) ]) diff --git a/config/kernel.m4 b/config/kernel.m4 index b22a00cdd..1e39c15ca 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -37,7 +37,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_OBJTOOL ZFS_AC_KERNEL_SRC_GLOBAL_PAGE_STATE ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE - ZFS_AC_KERNEL_SRC_CTL_NAME ZFS_AC_KERNEL_SRC_PDE_DATA ZFS_AC_KERNEL_SRC_FALLOCATE ZFS_AC_KERNEL_SRC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE @@ -51,33 +50,11 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_GROUP_INFO_GID ZFS_AC_KERNEL_SRC_RW ZFS_AC_KERNEL_SRC_TIMER_SETUP - ZFS_AC_KERNEL_SRC_CURRENT_BIO_TAIL ZFS_AC_KERNEL_SRC_SUPER_USER_NS - ZFS_AC_KERNEL_SRC_SUBMIT_BIO ZFS_AC_KERNEL_SRC_BLOCK_DEVICE_OPERATIONS - ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH - ZFS_AC_KERNEL_SRC_BLKDEV_REREAD_PART - ZFS_AC_KERNEL_SRC_INVALIDATE_BDEV - ZFS_AC_KERNEL_SRC_LOOKUP_BDEV - ZFS_AC_KERNEL_SRC_BDEV_OPEN_EXCLUSIVE - ZFS_AC_KERNEL_SRC_BDEV_LOGICAL_BLOCK_SIZE - ZFS_AC_KERNEL_SRC_BDEV_PHYSICAL_BLOCK_SIZE - ZFS_AC_KERNEL_SRC_BIO_BVEC_ITER - ZFS_AC_KERNEL_SRC_BIO_FAILFAST - ZFS_AC_KERNEL_SRC_BIO_SET_DEV - ZFS_AC_KERNEL_SRC_BIO_OPS - ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS - ZFS_AC_KERNEL_SRC_BIO_BI_STATUS - ZFS_AC_KERNEL_SRC_BIO_RW_BARRIER - ZFS_AC_KERNEL_SRC_BIO_RW_DISCARD - ZFS_AC_KERNEL_SRC_BLK_QUEUE_BDI - ZFS_AC_KERNEL_SRC_BLK_QUEUE_DISCARD - ZFS_AC_KERNEL_SRC_BLK_QUEUE_SECURE_ERASE - ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLAGS - 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_QUEUE_PLUG + ZFS_AC_KERNEL_SRC_BIO + ZFS_AC_KERNEL_SRC_BLKDEV + ZFS_AC_KERNEL_SRC_BLK_QUEUE ZFS_AC_KERNEL_SRC_GET_DISK_AND_MODULE ZFS_AC_KERNEL_SRC_GET_DISK_RO ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL @@ -97,12 +74,11 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_DIRTY_INODE ZFS_AC_KERNEL_SRC_SHRINKER ZFS_AC_KERNEL_SRC_MKDIR_UMODE_T - ZFS_AC_KERNEL_SRC_LOOKUP_NAMEIDATA - ZFS_AC_KERNEL_SRC_CREATE_NAMEIDATA + ZFS_AC_KERNEL_SRC_LOOKUP_FLAGS + ZFS_AC_KERNEL_SRC_CREATE_FLAGS ZFS_AC_KERNEL_SRC_GET_LINK ZFS_AC_KERNEL_SRC_PUT_LINK ZFS_AC_KERNEL_SRC_TMPFILE - ZFS_AC_KERNEL_SRC_TRUNCATE_RANGE ZFS_AC_KERNEL_SRC_AUTOMOUNT ZFS_AC_KERNEL_SRC_ENCODE_FH_WITH_INODE ZFS_AC_KERNEL_SRC_COMMIT_METADATA @@ -154,7 +130,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_ACCESS_OK_TYPE ZFS_AC_KERNEL_GLOBAL_PAGE_STATE ZFS_AC_KERNEL_OBJTOOL - ZFS_AC_KERNEL_CTL_NAME ZFS_AC_KERNEL_PDE_DATA ZFS_AC_KERNEL_FALLOCATE ZFS_AC_KERNEL_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE @@ -168,33 +143,11 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_GROUP_INFO_GID ZFS_AC_KERNEL_RW ZFS_AC_KERNEL_TIMER_SETUP - ZFS_AC_KERNEL_CURRENT_BIO_TAIL ZFS_AC_KERNEL_SUPER_USER_NS - ZFS_AC_KERNEL_SUBMIT_BIO ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS - ZFS_AC_KERNEL_BLKDEV_GET_BY_PATH - ZFS_AC_KERNEL_BLKDEV_REREAD_PART - ZFS_AC_KERNEL_INVALIDATE_BDEV - ZFS_AC_KERNEL_LOOKUP_BDEV - ZFS_AC_KERNEL_BDEV_OPEN_EXCLUSIVE - ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE - ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE - ZFS_AC_KERNEL_BIO_BVEC_ITER - ZFS_AC_KERNEL_BIO_FAILFAST - ZFS_AC_KERNEL_BIO_SET_DEV - ZFS_AC_KERNEL_BIO_OPS - ZFS_AC_KERNEL_BIO_END_IO_T_ARGS - ZFS_AC_KERNEL_BIO_BI_STATUS - ZFS_AC_KERNEL_BIO_RW_BARRIER - ZFS_AC_KERNEL_BIO_RW_DISCARD - ZFS_AC_KERNEL_BLK_QUEUE_BDI - ZFS_AC_KERNEL_BLK_QUEUE_DISCARD - ZFS_AC_KERNEL_BLK_QUEUE_SECURE_ERASE - ZFS_AC_KERNEL_BLK_QUEUE_FLAGS - 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_QUEUE_PLUG + ZFS_AC_KERNEL_BIO + ZFS_AC_KERNEL_BLKDEV + ZFS_AC_KERNEL_BLK_QUEUE ZFS_AC_KERNEL_GET_DISK_AND_MODULE ZFS_AC_KERNEL_GET_DISK_RO ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL @@ -214,12 +167,11 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_DIRTY_INODE ZFS_AC_KERNEL_SHRINKER ZFS_AC_KERNEL_MKDIR_UMODE_T - ZFS_AC_KERNEL_LOOKUP_NAMEIDATA - ZFS_AC_KERNEL_CREATE_NAMEIDATA + ZFS_AC_KERNEL_LOOKUP_FLAGS + ZFS_AC_KERNEL_CREATE_FLAGS ZFS_AC_KERNEL_GET_LINK ZFS_AC_KERNEL_PUT_LINK ZFS_AC_KERNEL_TMPFILE - ZFS_AC_KERNEL_TRUNCATE_RANGE ZFS_AC_KERNEL_AUTOMOUNT ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE ZFS_AC_KERNEL_COMMIT_METADATA @@ -391,6 +343,13 @@ AC_DEFUN([ZFS_AC_KERNEL], [ AC_MSG_RESULT([$kernsrcver]) + AS_VERSION_COMPARE([$kernsrcver], [$ZFS_META_KVER_MIN], [ + AC_MSG_ERROR([ + *** Cannot build against kernel version $kernsrcver. + *** The minimum supported kernel version is $ZFS_META_KVER_MIN. + ]) + ]) + LINUX=${kernelsrc} LINUX_OBJ=${kernelbuild} LINUX_VERSION=${kernsrcver} |