]> git.proxmox.com Git - mirror_zfs.git/blame - config/kernel-make-request-fn.m4
Linux 6.8 compat: handle mnt_idmap user_namespace change
[mirror_zfs.git] / config / kernel-make-request-fn.m4
CommitLineData
608f8749
BB
1dnl #
2dnl # Check for make_request_fn interface.
3dnl #
4AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
608f8749
BB
5 ZFS_LINUX_TEST_SRC([make_request_fn_void], [
6 #include <linux/blkdev.h>
a41d0b29 7 static void make_request(struct request_queue *q,
608f8749
BB
8 struct bio *bio) { return; }
9 ],[
10 blk_queue_make_request(NULL, &make_request);
11 ])
12
13 ZFS_LINUX_TEST_SRC([make_request_fn_blk_qc_t], [
14 #include <linux/blkdev.h>
a41d0b29 15 static blk_qc_t make_request(struct request_queue *q,
608f8749
BB
16 struct bio *bio) { return (BLK_QC_T_NONE); }
17 ],[
18 blk_queue_make_request(NULL, &make_request);
19 ])
68dde63d
BB
20
21 ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn], [
22 #include <linux/blkdev.h>
a41d0b29 23 static blk_qc_t make_request(struct request_queue *q,
68dde63d
BB
24 struct bio *bio) { return (BLK_QC_T_NONE); }
25 ],[
26 struct request_queue *q __attribute__ ((unused));
27 q = blk_alloc_queue(make_request, NUMA_NO_NODE);
28 ])
d817c171 29
6152014d
BB
30 ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [
31 #include <linux/blkdev.h>
a41d0b29 32 static blk_qc_t make_request(struct request_queue *q,
6152014d
BB
33 struct bio *bio) { return (BLK_QC_T_NONE); }
34 ],[
35 struct request_queue *q __attribute__ ((unused));
36 q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE);
37 ])
38
d817c171
CK
39 ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
40 #include <linux/blkdev.h>
41 ],[
42 struct block_device_operations o;
43 o.submit_bio = NULL;
44 ])
1b06b03a
BB
45
46 ZFS_LINUX_TEST_SRC([blk_alloc_disk], [
47 #include <linux/blkdev.h>
48 ],[
49 struct gendisk *disk __attribute__ ((unused));
50 disk = blk_alloc_disk(NUMA_NO_NODE);
51 ])
c26045b4
BB
52
53 ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [
54 #include <linux/blkdev.h>
55 ],[
56 struct gendisk *disk __attribute__ ((unused));
57 blk_cleanup_disk(disk);
58 ])
608f8749
BB
59])
60
61AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
d817c171 62 dnl # Checked as part of the blk_alloc_queue_request_fn test
608f8749 63 dnl #
d817c171
CK
64 dnl # Linux 5.9 API Change
65 dnl # make_request_fn was moved into block_device_operations->submit_bio
608f8749 66 dnl #
d817c171
CK
67 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations])
68 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [
608f8749 69 AC_MSG_RESULT(yes)
68dde63d 70
d817c171
CK
71 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
72 [submit_bio is member of struct block_device_operations])
1b06b03a
BB
73
74 dnl #
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().
78 dnl #
79 AC_MSG_CHECKING([whether blk_alloc_disk() exists])
80 ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [
81 AC_MSG_RESULT(yes)
82 AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists])
c26045b4
BB
83
84 dnl #
85 dnl # 5.20 API change,
86 dnl # Removed blk_cleanup_disk(), put_disk() should be used.
87 dnl #
88 AC_MSG_CHECKING([whether blk_cleanup_disk() exists])
89 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [
90 AC_MSG_RESULT(yes)
91 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1,
92 [blk_cleanup_disk() exists])
93 ], [
94 AC_MSG_RESULT(no)
95 ])
1b06b03a
BB
96 ], [
97 AC_MSG_RESULT(no)
98 ])
6152014d
BB
99 ],[
100 AC_MSG_RESULT(no)
101
68dde63d 102 dnl # Checked as part of the blk_alloc_queue_request_fn test
608f8749 103 dnl #
d817c171
CK
104 dnl # Linux 5.7 API Change
105 dnl # blk_alloc_queue() expects request function.
608f8749 106 dnl #
d817c171
CK
107 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
108 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
6152014d
BB
109 AC_MSG_RESULT(yes)
110
111 dnl # This is currently always the case.
d817c171 112 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
608f8749 113 AC_MSG_RESULT(yes)
d817c171
CK
114
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,
608f8749 118 [make_request_fn() return type])
d817c171
CK
119 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
120 [Noting that make_request_fn() returns blk_qc_t])
608f8749 121 ],[
68dde63d 122 dnl #
6152014d
BB
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.
68dde63d 128 dnl #
6152014d 129 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
68dde63d 130 AC_MSG_RESULT(yes)
6152014d
BB
131
132 dnl # This is currently always the case.
133 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
134 AC_MSG_RESULT(yes)
135
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,
68dde63d 139 [make_request_fn() return type])
6152014d
BB
140 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
141 [Noting that make_request_fn() returns blk_qc_t])
68dde63d 142 ],[
d817c171
CK
143 AC_MSG_RESULT(no)
144
145 dnl #
6152014d
BB
146 dnl # Linux 3.2 API Change
147 dnl # make_request_fn returns void.
d817c171
CK
148 dnl #
149 AC_MSG_CHECKING(
6152014d
BB
150 [whether make_request_fn() returns void])
151 ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
d817c171 152 AC_MSG_RESULT(yes)
6152014d 153 AC_DEFINE(MAKE_REQUEST_FN_RET, void,
d817c171 154 [make_request_fn() return type])
6152014d
BB
155 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
156 [Noting that make_request_fn() returns void])
d817c171 157 ],[
6152014d
BB
158 AC_MSG_RESULT(no)
159
160 dnl #
161 dnl # Linux 4.4 API Change
162 dnl # make_request_fn returns blk_qc_t.
163 dnl #
164 AC_MSG_CHECKING(
165 [whether make_request_fn() returns blk_qc_t])
166 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
167 AC_MSG_RESULT(yes)
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() ]
172 [returns blk_qc_t])
173 ],[
174 ZFS_LINUX_TEST_ERROR([make_request_fn])
175 ])
d817c171 176 ])
68dde63d 177 ])
608f8749
BB
178 ])
179 ])
180])