2 dnl # Check for make_request_fn interface.
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
5 ZFS_LINUX_TEST_SRC([make_request_fn_void], [
6 #include <linux/blkdev.h>
7 void make_request(struct request_queue *q,
8 struct bio *bio) { return; }
10 blk_queue_make_request(NULL, &make_request);
13 ZFS_LINUX_TEST_SRC([make_request_fn_blk_qc_t], [
14 #include <linux/blkdev.h>
15 blk_qc_t make_request(struct request_queue *q,
16 struct bio *bio) { return (BLK_QC_T_NONE); }
18 blk_queue_make_request(NULL, &make_request);
21 ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn], [
22 #include <linux/blkdev.h>
23 blk_qc_t make_request(struct request_queue *q,
24 struct bio *bio) { return (BLK_QC_T_NONE); }
26 struct request_queue *q __attribute__ ((unused));
27 q = blk_alloc_queue(make_request, NUMA_NO_NODE);
30 ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [
31 #include <linux/blkdev.h>
32 blk_qc_t make_request(struct request_queue *q,
33 struct bio *bio) { return (BLK_QC_T_NONE); }
35 struct request_queue *q __attribute__ ((unused));
36 q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE);
39 ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
40 #include <linux/blkdev.h>
42 struct block_device_operations o;
47 AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
48 dnl # Checked as part of the blk_alloc_queue_request_fn test
50 dnl # Linux 5.9 API Change
51 dnl # make_request_fn was moved into block_device_operations->submit_bio
53 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations])
54 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [
57 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
58 [submit_bio is member of struct block_device_operations])
62 dnl # Checked as part of the blk_alloc_queue_request_fn test
64 dnl # Linux 5.7 API Change
65 dnl # blk_alloc_queue() expects request function.
67 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
68 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
71 dnl # This is currently always the case.
72 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
75 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1,
76 [blk_alloc_queue() expects request function])
77 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
78 [make_request_fn() return type])
79 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
80 [Noting that make_request_fn() returns blk_qc_t])
83 dnl # CentOS Stream 4.18.0-257 API Change
84 dnl # The Linux 5.7 blk_alloc_queue() change was back-
85 dnl # ported and the symbol renamed blk_alloc_queue_rh().
86 dnl # As of this kernel version they're not providing
87 dnl # any compatibility code in the kernel for this.
89 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
92 dnl # This is currently always the case.
93 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
96 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
97 [blk_alloc_queue_rh() expects request function])
98 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
99 [make_request_fn() return type])
100 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
101 [Noting that make_request_fn() returns blk_qc_t])
106 dnl # Linux 3.2 API Change
107 dnl # make_request_fn returns void.
110 [whether make_request_fn() returns void])
111 ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
113 AC_DEFINE(MAKE_REQUEST_FN_RET, void,
114 [make_request_fn() return type])
115 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
116 [Noting that make_request_fn() returns void])
121 dnl # Linux 4.4 API Change
122 dnl # make_request_fn returns blk_qc_t.
125 [whether make_request_fn() returns blk_qc_t])
126 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
128 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
129 [make_request_fn() return type])
130 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
131 [Noting that make_request_fn() ]
134 ZFS_LINUX_TEST_ERROR([make_request_fn])