]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - config/kernel-bio-op.m4
Fix autoconf detection of super_setup_bdi_name
[FreeBSD/FreeBSD.git] / config / kernel-bio-op.m4
1 dnl #
2 dnl # Linux 4.8 API,
3 dnl #
4 dnl # The bio_op() helper was introduced as a replacement for explicitly
5 dnl # checking the bio->bi_rw flags.  The following checks are used to
6 dnl # detect if a specific operation is supported.
7 dnl #
8 AC_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         ],[
13                 int op __attribute__ ((unused)) = REQ_OP_DISCARD;
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
23 AC_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         ],[
28                 int op __attribute__ ((unused)) = REQ_OP_SECURE_ERASE;
29         ],[
30                 AC_MSG_RESULT(yes)
31                 AC_DEFINE(HAVE_REQ_OP_SECURE_ERASE, 1,
32                     [REQ_OP_SECURE_ERASE is defined])
33         ],[
34                 AC_MSG_RESULT(no)
35         ])
36 ])
37
38
39 AC_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         ],[
44                 int op __attribute__ ((unused)) = REQ_OP_FLUSH;
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
54 AC_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 ])
68
69 AC_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([
72                 #include <linux/bio.h>
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 ])