aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2016-12-30 16:03:59 -0600
committerBrian Behlendorf <[email protected]>2016-12-30 16:03:59 -0600
commita5e046eaacad20487188c9eef231554e1401d8c9 (patch)
tree41395397905b3e0fa0e908193412c3fd9b273446 /config
parent3500a145952e0dfb7b7efe1c6b7856319815628c (diff)
4.10 compat - BIO flag changes and others
[bio] The req_op enum was changed to req_opf. Update the "Linux 4.8 API" autotools checks to use an int to determine whether the various REQ_OP values are defined. This should work properly on kernels >= 4.8. [bio] bio_set_op_attrs() is now an inline function and can't be detected with #ifdef. Add a configure check to determine whether bio_set_op_attrs() is defined. Move the local definition of it from vdev_disk.c to blkdev_compat.h for consistency with other related compability shims. [bio] The read/write flags and their modifiers, including WRITE_FLUSH, WRITE_FUA and WRITE_FLUSH_FUA have been removed from fs.h. Add the new bio_set_flush() compatibility wrapper to replace VDEV_WRITE_FLUSH_FUA and set the flags appropriately for each supported kernel version. [vfs] The generic_readlink() function has been made static. If .readlink in inode_operations is NULL, generic_readlink() is used. [zol typo] Completely unrelated to 4.10 compat, fix a typo in the check for REQ_OP_SECURE_ERASE so that the proper macro is defined: s/HAVE_REQ_OP_SECURE_DISCARD/HAVE_REQ_OP_SECURE_ERASE/ Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #5499
Diffstat (limited to 'config')
-rw-r--r--config/kernel-bio-op.m425
-rw-r--r--config/kernel-generic_readlink.m422
-rw-r--r--config/kernel.m42
3 files changed, 45 insertions, 4 deletions
diff --git a/config/kernel-bio-op.m4 b/config/kernel-bio-op.m4
index b4b699517..5559d6c7f 100644
--- a/config/kernel-bio-op.m4
+++ b/config/kernel-bio-op.m4
@@ -10,7 +10,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_DISCARD], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/blk_types.h>
],[
- enum req_op op __attribute__ ((unused)) = REQ_OP_DISCARD;
+ int op __attribute__ ((unused)) = REQ_OP_DISCARD;
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_REQ_OP_DISCARD, 1,
@@ -25,10 +25,10 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/blk_types.h>
],[
- enum req_op op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
+ int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
],[
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_REQ_OP_SECURE_DISCARD, 1,
+ AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
[REQ_OP_SECURE_ERASE is defined])
],[
AC_MSG_RESULT(no)
@@ -41,7 +41,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_FLUSH], [
ZFS_LINUX_TRY_COMPILE([
#include <linux/blk_types.h>
],[
- enum req_op op __attribute__ ((unused)) = REQ_OP_FLUSH;
+ int op __attribute__ ((unused)) = REQ_OP_FLUSH;
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_REQ_OP_FLUSH, 1,
@@ -65,3 +65,20 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
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_TRY_COMPILE([
+ #include <linux/blk_types.h>
+ ],[
+ struct bio *bio __attribute__ ((unused)) = NULL;
+
+ bio_set_op_attrs(bio, 0, 0);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1,
+ [bio_set_op_attrs is available])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/kernel-generic_readlink.m4 b/config/kernel-generic_readlink.m4
new file mode 100644
index 000000000..914431de4
--- /dev/null
+++ b/config/kernel-generic_readlink.m4
@@ -0,0 +1,22 @@
+dnl #
+dnl # 4.10 API
+dnl #
+dnl # NULL inode_operations.readlink implies generic_readlink(), which
+dnl # has been made static.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL], [
+ AC_MSG_CHECKING([whether generic_readlink is global])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ int i __attribute__ ((unused));
+
+ i = generic_readlink(NULL, NULL, 0);
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_GENERIC_READLINK, 1,
+ [generic_readlink is global])
+ ],[
+ AC_MSG_RESULT([no])
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 08f544a78..980d2801f 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -37,6 +37,8 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_BLK_QUEUE_HAVE_BLK_PLUG
ZFS_AC_KERNEL_GET_DISK_RO
ZFS_AC_KERNEL_GET_GENDISK
+ ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS
+ ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
ZFS_AC_KERNEL_DISCARD_GRANULARITY
ZFS_AC_KERNEL_CONST_XATTR_HANDLER
ZFS_AC_KERNEL_XATTR_HANDLER_NAME