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);
54 AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
55 dnl # Checked as part of the blk_alloc_queue_request_fn test
57 dnl # Linux 5.9 API Change
58 dnl # make_request_fn was moved into block_device_operations->submit_bio
60 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations])
61 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [
64 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
65 [submit_bio is member of struct block_device_operations])
68 dnl # Linux 5.14 API Change:
69 dnl # blk_alloc_queue() + alloc_disk() combo replaced by
70 dnl # a single call to blk_alloc_disk().
72 AC_MSG_CHECKING([whether blk_alloc_disk() exists])
73 ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
75 AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
82 dnl # Checked as part of the blk_alloc_queue_request_fn test
84 dnl # Linux 5.7 API Change
85 dnl # blk_alloc_queue() expects request function.
87 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
88 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
91 dnl # This is currently always the case.
92 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
95 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1,
96 [blk_alloc_queue() expects request function])
97 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
98 [make_request_fn() return type])
99 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
100 [Noting that make_request_fn() returns blk_qc_t])
103 dnl # CentOS Stream 4.18.0-257 API Change
104 dnl # The Linux 5.7 blk_alloc_queue() change was back-
105 dnl # ported and the symbol renamed blk_alloc_queue_rh().
106 dnl # As of this kernel version they're not providing
107 dnl # any compatibility code in the kernel for this.
109 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
112 dnl # This is currently always the case.
113 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
116 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
117 [blk_alloc_queue_rh() expects request function])
118 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
119 [make_request_fn() return type])
120 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
121 [Noting that make_request_fn() returns blk_qc_t])
126 dnl # Linux 3.2 API Change
127 dnl # make_request_fn returns void.
130 [whether make_request_fn() returns void])
131 ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
133 AC_DEFINE(MAKE_REQUEST_FN_RET, void,
134 [make_request_fn() return type])
135 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
136 [Noting that make_request_fn() returns void])
141 dnl # Linux 4.4 API Change
142 dnl # make_request_fn returns blk_qc_t.
145 [whether make_request_fn() returns blk_qc_t])
146 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
148 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
149 [make_request_fn() return type])
150 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
151 [Noting that make_request_fn() ]
154 ZFS_LINUX_TEST_ERROR([make_request_fn])