]> granicus.if.org Git - zfs/blob - config/kernel-bio-end-io-t-args.m4
Fix for ARC sysctls ignored at runtime
[zfs] / config / kernel-bio-end-io-t-args.m4
1 dnl #
2 dnl # 4.3 API change
3 dnl # Error argument dropped from bio_endio in favor of newly introduced
4 dnl # bio->bi_error. This also replaces bio->bi_flags value BIO_UPTODATE.
5 dnl # Introduced by torvalds/linux@4246a0b63bd8f56a1469b12eafeb875b1041a451
6 dnl # ("block: add a bi_error field to struct bio").
7 dnl #
8 AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_END_IO_T_ARGS], [
9         ZFS_LINUX_TEST_SRC([bio_end_io_t_args], [
10                 #include <linux/bio.h>
11                 void wanted_end_io(struct bio *bio) { return; }
12                 bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
13         ], [])
14 ])
15
16 AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
17         AC_MSG_CHECKING([whether bio_end_io_t wants 1 arg])
18         ZFS_LINUX_TEST_RESULT([bio_end_io_t_args], [
19                 AC_MSG_RESULT(yes)
20                 AC_DEFINE(HAVE_1ARG_BIO_END_IO_T, 1,
21                     [bio_end_io_t wants 1 arg])
22         ], [
23                 AC_MSG_RESULT(no)
24         ])
25 ])
26
27 dnl #
28 dnl # 4.13 API change
29 dnl # The bio->bi_error field was replaced with bio->bi_status which is an
30 dnl # enum which describes all possible error types.
31 dnl #
32 AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_BI_STATUS], [
33         ZFS_LINUX_TEST_SRC([bio_bi_status], [
34                 #include <linux/bio.h>
35         ], [
36                 struct bio bio __attribute__ ((unused));
37                 blk_status_t status __attribute__ ((unused)) = BLK_STS_OK;
38                 bio.bi_status = status;
39         ])
40 ])
41
42 AC_DEFUN([ZFS_AC_KERNEL_BIO_BI_STATUS], [
43         AC_MSG_CHECKING([whether bio->bi_status exists])
44         ZFS_LINUX_TEST_RESULT([bio_bi_status], [
45                 AC_MSG_RESULT(yes)
46                 AC_DEFINE(HAVE_BIO_BI_STATUS, 1, [bio->bi_status exists])
47         ],[
48                 AC_MSG_RESULT(no)
49         ])
50 ])