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;
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_cleanup_disk], [
54 #include <linux/blkdev.h>
56 struct gendisk *disk __attribute__ ((unused));
57 blk_cleanup_disk(disk);
61 AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
62 dnl # Checked as part of the blk_alloc_queue_request_fn test
64 dnl # Linux 5.9 API Change
65 dnl # make_request_fn was moved into block_device_operations->submit_bio
67 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations])
68 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [
71 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
72 [submit_bio is member of struct block_device_operations])
75 dnl # Linux 5.14 API Change:
76 dnl # blk_alloc_queue() + alloc_disk() combo replaced by
77 dnl # a single call to blk_alloc_disk().
79 AC_MSG_CHECKING([whether blk_alloc_disk() exists])
80 ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
82 AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
85 dnl # 5.20 API change,
86 dnl # Removed blk_cleanup_disk(), put_disk() should be used.
88 AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
89 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
91 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
92 [blk_cleanup_disk() exists])
102 dnl # Checked as part of the blk_alloc_queue_request_fn test
104 dnl # Linux 5.7 API Change
105 dnl # blk_alloc_queue() expects request function.
107 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
108 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
111 dnl # This is currently always the case.
112 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
115 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1,
116 [blk_alloc_queue() expects request function])
117 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
118 [make_request_fn() return type])
119 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
120 [Noting that make_request_fn() returns blk_qc_t])
123 dnl # CentOS Stream 4.18.0-257 API Change
124 dnl # The Linux 5.7 blk_alloc_queue() change was back-
125 dnl # ported and the symbol renamed blk_alloc_queue_rh().
126 dnl # As of this kernel version they're not providing
127 dnl # any compatibility code in the kernel for this.
129 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
132 dnl # This is currently always the case.
133 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
136 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
137 [blk_alloc_queue_rh() expects request function])
138 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
139 [make_request_fn() return type])
140 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
141 [Noting that make_request_fn() returns blk_qc_t])
146 dnl # Linux 3.2 API Change
147 dnl # make_request_fn returns void.
150 [whether make_request_fn() returns void])
151 ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
153 AC_DEFINE(MAKE_REQUEST_FN_RET, void,
154 [make_request_fn() return type])
155 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
156 [Noting that make_request_fn() returns void])
161 dnl # Linux 4.4 API Change
162 dnl # make_request_fn returns blk_qc_t.
165 [whether make_request_fn() returns blk_qc_t])
166 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
168 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
169 [make_request_fn() return type])
170 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
171 [Noting that make_request_fn() ]
174 ZFS_LINUX_TEST_ERROR([make_request_fn])