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 static 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 static 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 static 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 static 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;
46 ZFS_LINUX_TEST_SRC([blk_alloc_disk], [
47 #include <linux/blkdev.h>
49 struct gendisk *disk __attribute__ ((unused));
50 disk = blk_alloc_disk(NUMA_NO_NODE);
53 ZFS_LINUX_TEST_SRC([blk_alloc_disk_2arg], [
54 #include <linux/blkdev.h>
56 struct queue_limits *lim = NULL;
57 struct gendisk *disk __attribute__ ((unused));
58 disk = blk_alloc_disk(lim, NUMA_NO_NODE);
61 ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [
62 #include <linux/blkdev.h>
64 struct gendisk *disk __attribute__ ((unused));
65 blk_cleanup_disk(disk);
69 AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
70 dnl # Checked as part of the blk_alloc_queue_request_fn test
72 dnl # Linux 5.9 API Change
73 dnl # make_request_fn was moved into block_device_operations->submit_bio
75 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations])
76 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [
79 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
80 [submit_bio is member of struct block_device_operations])
83 dnl # Linux 5.14 API Change:
84 dnl # blk_alloc_queue() + alloc_disk() combo replaced by
85 dnl # a single call to blk_alloc_disk().
87 AC_MSG_CHECKING([whether blk_alloc_disk() exists])
88 ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
90 AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
93 dnl # 5.20 API change,
94 dnl # Removed blk_cleanup_disk(), put_disk() should be used.
96 AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
97 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
99 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
100 [blk_cleanup_disk() exists])
109 dnl # Linux 6.9 API Change:
110 dnl # blk_alloc_queue() takes a nullable queue_limits arg.
112 AC_MSG_CHECKING([whether blk_alloc_disk() exists and takes 2 args])
113 ZFS_LINUX_TEST_RESULT([blk_alloc_disk_2arg], [
115 AC_DEFINE([HAVE_BLK_ALLOC_DISK_2ARG], 1, [blk_alloc_disk() exists and takes 2 args])
118 dnl # 5.20 API change,
119 dnl # Removed blk_cleanup_disk(), put_disk() should be used.
121 AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
122 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
124 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
125 [blk_cleanup_disk() exists])
135 dnl # Checked as part of the blk_alloc_queue_request_fn test
137 dnl # Linux 5.7 API Change
138 dnl # blk_alloc_queue() expects request function.
140 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
141 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
144 dnl # This is currently always the case.
145 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
148 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1,
149 [blk_alloc_queue() expects request function])
150 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
151 [make_request_fn() return type])
152 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
153 [Noting that make_request_fn() returns blk_qc_t])
156 dnl # CentOS Stream 4.18.0-257 API Change
157 dnl # The Linux 5.7 blk_alloc_queue() change was back-
158 dnl # ported and the symbol renamed blk_alloc_queue_rh().
159 dnl # As of this kernel version they're not providing
160 dnl # any compatibility code in the kernel for this.
162 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
165 dnl # This is currently always the case.
166 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
169 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
170 [blk_alloc_queue_rh() expects request function])
171 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
172 [make_request_fn() return type])
173 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
174 [Noting that make_request_fn() returns blk_qc_t])
179 dnl # Linux 3.2 API Change
180 dnl # make_request_fn returns void.
183 [whether make_request_fn() returns void])
184 ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
186 AC_DEFINE(MAKE_REQUEST_FN_RET, void,
187 [make_request_fn() return type])
188 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
189 [Noting that make_request_fn() returns void])
194 dnl # Linux 4.4 API Change
195 dnl # make_request_fn returns blk_qc_t.
198 [whether make_request_fn() returns blk_qc_t])
199 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
201 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
202 [make_request_fn() return type])
203 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
204 [Noting that make_request_fn() ]
207 ZFS_LINUX_TEST_ERROR([make_request_fn])