]> git.proxmox.com Git - mirror_zfs-debian.git/blame - config/kernel-bio-op.m4
New upstream version 0.7.11
[mirror_zfs-debian.git] / config / kernel-bio-op.m4
CommitLineData
87dac73d
AX
1dnl #
2dnl # Linux 4.8 API,
3dnl #
4dnl # The bio_op() helper was introduced as a replacement for explicitly
5dnl # checking the bio->bi_rw flags. The following checks are used to
6dnl # detect if a specific operation is supported.
7dnl #
8AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_DISCARD], [
9 AC_MSG_CHECKING([whether REQ_OP_DISCARD is defined])
10 ZFS_LINUX_TRY_COMPILE([
11 #include <linux/blk_types.h>
12 ],[
68d83c55 13 int op __attribute__ ((unused)) = REQ_OP_DISCARD;
87dac73d
AX
14 ],[
15 AC_MSG_RESULT(yes)
16 AC_DEFINE(HAVE_REQ_OP_DISCARD, 1,
17 [REQ_OP_DISCARD is defined])
18 ],[
19 AC_MSG_RESULT(no)
20 ])
21])
22
23AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_SECURE_ERASE], [
24 AC_MSG_CHECKING([whether REQ_OP_SECURE_ERASE is defined])
25 ZFS_LINUX_TRY_COMPILE([
26 #include <linux/blk_types.h>
27 ],[
68d83c55 28 int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
87dac73d
AX
29 ],[
30 AC_MSG_RESULT(yes)
68d83c55 31 AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
87dac73d
AX
32 [REQ_OP_SECURE_ERASE is defined])
33 ],[
34 AC_MSG_RESULT(no)
35 ])
36])
37
38
39AC_DEFUN([ZFS_AC_KERNEL_REQ_OP_FLUSH], [
40 AC_MSG_CHECKING([whether REQ_OP_FLUSH is defined])
41 ZFS_LINUX_TRY_COMPILE([
42 #include <linux/blk_types.h>
43 ],[
68d83c55 44 int op __attribute__ ((unused)) = REQ_OP_FLUSH;
87dac73d
AX
45 ],[
46 AC_MSG_RESULT(yes)
47 AC_DEFINE(HAVE_REQ_OP_FLUSH, 1,
48 [REQ_OP_FLUSH is defined])
49 ],[
50 AC_MSG_RESULT(no)
51 ])
52])
53
54AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_OPF], [
55 AC_MSG_CHECKING([whether bio->bi_opf is defined])
56 ZFS_LINUX_TRY_COMPILE([
57 #include <linux/bio.h>
58 ],[
59 struct bio bio __attribute__ ((unused));
60 bio.bi_opf = 0;
61 ],[
62 AC_MSG_RESULT(yes)
63 AC_DEFINE(HAVE_BIO_BI_OPF, 1, [bio->bi_opf is defined])
64 ],[
65 AC_MSG_RESULT(no)
66 ])
67])
68d83c55
AX
68
69AC_DEFUN([ZFS_AC_KERNEL_HAVE_BIO_SET_OP_ATTRS], [
70 AC_MSG_CHECKING([whether bio_set_op_attrs is available])
71 ZFS_LINUX_TRY_COMPILE([
cae5b340 72 #include <linux/bio.h>
68d83c55
AX
73 ],[
74 struct bio *bio __attribute__ ((unused)) = NULL;
75
76 bio_set_op_attrs(bio, 0, 0);
77 ],[
78 AC_MSG_RESULT(yes)
79 AC_DEFINE(HAVE_BIO_SET_OP_ATTRS, 1,
80 [bio_set_op_attrs is available])
81 ],[
82 AC_MSG_RESULT(no)
83 ])
84])