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_blk_qc_t], [
6 #include <linux/blkdev.h>
7 static blk_qc_t make_request(struct request_queue *q,
8 struct bio *bio) { return (BLK_QC_T_NONE); }
10 blk_queue_make_request(NULL, &make_request);
13 ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn], [
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 struct request_queue *q __attribute__ ((unused));
19 q = blk_alloc_queue(make_request, NUMA_NO_NODE);
22 ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [
23 #include <linux/blkdev.h>
24 static blk_qc_t make_request(struct request_queue *q,
25 struct bio *bio) { return (BLK_QC_T_NONE); }
27 struct request_queue *q __attribute__ ((unused));
28 q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE);
31 ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
32 #include <linux/blkdev.h>
34 struct block_device_operations o;
38 ZFS_LINUX_TEST_SRC([blk_alloc_disk], [
39 #include <linux/blkdev.h>
41 struct gendisk *disk __attribute__ ((unused));
42 disk = blk_alloc_disk(NUMA_NO_NODE);
45 ZFS_LINUX_TEST_SRC([blk_alloc_disk_2arg], [
46 #include <linux/blkdev.h>
48 struct queue_limits *lim = NULL;
49 struct gendisk *disk __attribute__ ((unused));
50 disk = blk_alloc_disk(lim, NUMA_NO_NODE);
53 ZFS_LINUX_TEST_SRC([blkdev_queue_limits_features], [
54 #include <linux/blkdev.h>
56 struct queue_limits *lim = NULL;
60 ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [
61 #include <linux/blkdev.h>
63 struct gendisk *disk __attribute__ ((unused));
64 blk_cleanup_disk(disk);
68 AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
69 dnl # Checked as part of the blk_alloc_queue_request_fn test
71 dnl # Linux 5.9 API Change
72 dnl # make_request_fn was moved into block_device_operations->submit_bio
74 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations])
75 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [
78 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
79 [submit_bio is member of struct block_device_operations])
82 dnl # Linux 5.14 API Change:
83 dnl # blk_alloc_queue() + alloc_disk() combo replaced by
84 dnl # a single call to blk_alloc_disk().
86 AC_MSG_CHECKING([whether blk_alloc_disk() exists])
87 ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
89 AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
92 dnl # 5.20 API change,
93 dnl # Removed blk_cleanup_disk(), put_disk() should be used.
95 AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
96 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
98 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
99 [blk_cleanup_disk() exists])
108 dnl # Linux 6.9 API Change:
109 dnl # blk_alloc_queue() takes a nullable queue_limits arg.
111 AC_MSG_CHECKING([whether blk_alloc_disk() exists and takes 2 args])
112 ZFS_LINUX_TEST_RESULT([blk_alloc_disk_2arg], [
114 AC_DEFINE([HAVE_BLK_ALLOC_DISK_2ARG], 1, [blk_alloc_disk() exists and takes 2 args])
117 dnl # Linux 6.11 API change:
118 dnl # struct queue_limits gains a 'features' field,
119 dnl # used to set flushing options
121 AC_MSG_CHECKING([whether struct queue_limits has a features field])
122 ZFS_LINUX_TEST_RESULT([blkdev_queue_limits_features], [
124 AC_DEFINE([HAVE_BLKDEV_QUEUE_LIMITS_FEATURES], 1,
125 [struct queue_limits has a features field])
131 dnl # 5.20 API change,
132 dnl # Removed blk_cleanup_disk(), put_disk() should be used.
134 AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
135 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
137 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
138 [blk_cleanup_disk() exists])
148 dnl # Checked as part of the blk_alloc_queue_request_fn test
150 dnl # Linux 5.7 API Change
151 dnl # blk_alloc_queue() expects request function.
153 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
154 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
157 dnl # This is currently always the case.
158 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
161 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1,
162 [blk_alloc_queue() expects request function])
163 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
164 [make_request_fn() return type])
165 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
166 [Noting that make_request_fn() returns blk_qc_t])
169 dnl # CentOS Stream 4.18.0-257 API Change
170 dnl # The Linux 5.7 blk_alloc_queue() change was back-
171 dnl # ported and the symbol renamed blk_alloc_queue_rh().
172 dnl # As of this kernel version they're not providing
173 dnl # any compatibility code in the kernel for this.
175 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
178 dnl # This is currently always the case.
179 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
182 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
183 [blk_alloc_queue_rh() expects request function])
184 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
185 [make_request_fn() return type])
186 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
187 [Noting that make_request_fn() returns blk_qc_t])
192 dnl # Linux 4.4 API Change
193 dnl # make_request_fn returns blk_qc_t.
196 [whether make_request_fn() returns blk_qc_t])
197 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
199 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
200 [make_request_fn() return type])
201 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
202 [Noting that make_request_fn() ]
205 ZFS_LINUX_TEST_ERROR([make_request_fn])