summaryrefslogtreecommitdiffstats
path: root/config/kernel-bio-op.m4
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2016-08-09 11:22:30 -0700
committerBrian Behlendorf <[email protected]>2016-08-11 11:19:34 -0700
commitcf41432c70c2df282f0f4ed7647154f3f4972d34 (patch)
tree8ff55f47cdce764a0de0571d605ea382219ed60d /config/kernel-bio-op.m4
parent689f093ebcfa0d57895495050d2b470ed2bef52e (diff)
Linux 4.8 compat: Fix removal of bio->bi_rw member
All users of bio->bi_rw have been replaced with compatibility wrappers. This allows the kernel specific logic to be abstracted away, and for each of the supported cases to be documented with the wrapper. The updated interfaces are as follows: * void blk_queue_set_write_cache(struct request_queue *, bool, bool) * boolean_t bio_is_flush(struct bio *) * boolean_t bio_is_fua(struct bio *) * boolean_t bio_is_discard(struct bio *) * boolean_t bio_is_secure_erase(struct bio *) * VDEV_WRITE_FLUSH_FUA Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #4951
Diffstat (limited to 'config/kernel-bio-op.m4')
-rw-r--r--config/kernel-bio-op.m467
1 files changed, 67 insertions, 0 deletions
diff --git a/config/kernel-bio-op.m4 b/config/kernel-bio-op.m4
new file mode 100644
index 000000000..b4b699517
--- /dev/null
+++ b/config/kernel-bio-op.m4
@@ -0,0 +1,67 @@
+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_REQ_OP_DISCARD], [
+ AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/blk_types.h>
+ ],[
+ enum req_op op __attribute__ ((unused)) = 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_TRY_COMPILE([
+ #include <linux/blk_types.h>
+ ],[
+ enum req_op op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_REQ_OP_SECURE_DISCARD, 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_TRY_COMPILE([
+ #include <linux/blk_types.h>
+ ],[
+ enum req_op op __attribute__ ((unused)) = 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_TRY_COMPILE([
+ #include <linux/bio.h>
+ ],[
+ struct bio bio __attribute__ ((unused));
+ bio.bi_opf = 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])