1dnl # 2dnl # Check for make_request_fn interface. 3dnl # 4AC_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; } 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> 15 static blk_qc_t make_request(struct request_queue *q, 16 struct bio *bio) { return (BLK_QC_T_NONE); } 17 ],[ 18 blk_queue_make_request(NULL, &make_request); 19 ]) 20 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); } 25 ],[ 26 struct request_queue *q __attribute__ ((unused)); 27 q = blk_alloc_queue(make_request, NUMA_NO_NODE); 28 ]) 29 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); } 34 ],[ 35 struct request_queue *q __attribute__ ((unused)); 36 q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE); 37 ]) 38 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 ]) 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 ]) 52 53 ZFS_LINUX_TEST_SRC([blk_alloc_disk_2arg], [ 54 #include <linux/blkdev.h> 55 ],[ 56 struct queue_limits *lim = NULL; 57 struct gendisk *disk __attribute__ ((unused)); 58 disk = blk_alloc_disk(lim, NUMA_NO_NODE); 59 ]) 60 61 ZFS_LINUX_TEST_SRC([blkdev_queue_limits_features], [ 62 #include <linux/blkdev.h> 63 ],[ 64 struct queue_limits *lim = NULL; 65 lim->features = 0; 66 ]) 67 68 ZFS_LINUX_TEST_SRC([blk_cleanup_disk], [ 69 #include <linux/blkdev.h> 70 ],[ 71 struct gendisk *disk __attribute__ ((unused)); 72 blk_cleanup_disk(disk); 73 ]) 74]) 75 76AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ 77 dnl # Checked as part of the blk_alloc_queue_request_fn test 78 dnl # 79 dnl # Linux 5.9 API Change 80 dnl # make_request_fn was moved into block_device_operations->submit_bio 81 dnl # 82 AC_MSG_CHECKING([whether submit_bio is member of struct block_device_operations]) 83 ZFS_LINUX_TEST_RESULT([block_device_operations_submit_bio], [ 84 AC_MSG_RESULT(yes) 85 86 AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1, 87 [submit_bio is member of struct block_device_operations]) 88 89 dnl # 90 dnl # Linux 5.14 API Change: 91 dnl # blk_alloc_queue() + alloc_disk() combo replaced by 92 dnl # a single call to blk_alloc_disk(). 93 dnl # 94 AC_MSG_CHECKING([whether blk_alloc_disk() exists]) 95 ZFS_LINUX_TEST_RESULT([blk_alloc_disk], [ 96 AC_MSG_RESULT(yes) 97 AC_DEFINE([HAVE_BLK_ALLOC_DISK], 1, [blk_alloc_disk() exists]) 98 99 dnl # 100 dnl # 5.20 API change, 101 dnl # Removed blk_cleanup_disk(), put_disk() should be used. 102 dnl # 103 AC_MSG_CHECKING([whether blk_cleanup_disk() exists]) 104 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [ 105 AC_MSG_RESULT(yes) 106 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1, 107 [blk_cleanup_disk() exists]) 108 ], [ 109 AC_MSG_RESULT(no) 110 ]) 111 ], [ 112 AC_MSG_RESULT(no) 113 ]) 114 115 dnl # 116 dnl # Linux 6.9 API Change: 117 dnl # blk_alloc_queue() takes a nullable queue_limits arg. 118 dnl # 119 AC_MSG_CHECKING([whether blk_alloc_disk() exists and takes 2 args]) 120 ZFS_LINUX_TEST_RESULT([blk_alloc_disk_2arg], [ 121 AC_MSG_RESULT(yes) 122 AC_DEFINE([HAVE_BLK_ALLOC_DISK_2ARG], 1, [blk_alloc_disk() exists and takes 2 args]) 123 124 dnl # 125 dnl # Linux 6.11 API change: 126 dnl # struct queue_limits gains a 'features' field, 127 dnl # used to set flushing options 128 dnl # 129 AC_MSG_CHECKING([whether struct queue_limits has a features field]) 130 ZFS_LINUX_TEST_RESULT([blkdev_queue_limits_features], [ 131 AC_MSG_RESULT(yes) 132 AC_DEFINE([HAVE_BLKDEV_QUEUE_LIMITS_FEATURES], 1, 133 [struct queue_limits has a features field]) 134 ], [ 135 AC_MSG_RESULT(no) 136 ]) 137 138 dnl # 139 dnl # 5.20 API change, 140 dnl # Removed blk_cleanup_disk(), put_disk() should be used. 141 dnl # 142 AC_MSG_CHECKING([whether blk_cleanup_disk() exists]) 143 ZFS_LINUX_TEST_RESULT([blk_cleanup_disk], [ 144 AC_MSG_RESULT(yes) 145 AC_DEFINE([HAVE_BLK_CLEANUP_DISK], 1, 146 [blk_cleanup_disk() exists]) 147 ], [ 148 AC_MSG_RESULT(no) 149 ]) 150 ], [ 151 AC_MSG_RESULT(no) 152 ]) 153 ],[ 154 AC_MSG_RESULT(no) 155 156 dnl # Checked as part of the blk_alloc_queue_request_fn test 157 dnl # 158 dnl # Linux 5.7 API Change 159 dnl # blk_alloc_queue() expects request function. 160 dnl # 161 AC_MSG_CHECKING([whether blk_alloc_queue() expects request function]) 162 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [ 163 AC_MSG_RESULT(yes) 164 165 dnl # This is currently always the case. 166 AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t]) 167 AC_MSG_RESULT(yes) 168 169 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN, 1, 170 [blk_alloc_queue() 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]) 175 ],[ 176 dnl # 177 dnl # CentOS Stream 4.18.0-257 API Change 178 dnl # The Linux 5.7 blk_alloc_queue() change was back- 179 dnl # ported and the symbol renamed blk_alloc_queue_rh(). 180 dnl # As of this kernel version they're not providing 181 dnl # any compatibility code in the kernel for this. 182 dnl # 183 ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [ 184 AC_MSG_RESULT(yes) 185 186 dnl # This is currently always the case. 187 AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t]) 188 AC_MSG_RESULT(yes) 189 190 AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1, 191 [blk_alloc_queue_rh() expects request function]) 192 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t, 193 [make_request_fn() return type]) 194 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1, 195 [Noting that make_request_fn() returns blk_qc_t]) 196 ],[ 197 AC_MSG_RESULT(no) 198 199 dnl # 200 dnl # Linux 3.2 API Change 201 dnl # make_request_fn returns void. 202 dnl # 203 AC_MSG_CHECKING( 204 [whether make_request_fn() returns void]) 205 ZFS_LINUX_TEST_RESULT([make_request_fn_void], [ 206 AC_MSG_RESULT(yes) 207 AC_DEFINE(MAKE_REQUEST_FN_RET, void, 208 [make_request_fn() return type]) 209 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1, 210 [Noting that make_request_fn() returns void]) 211 ],[ 212 AC_MSG_RESULT(no) 213 214 dnl # 215 dnl # Linux 4.4 API Change 216 dnl # make_request_fn returns blk_qc_t. 217 dnl # 218 AC_MSG_CHECKING( 219 [whether make_request_fn() returns blk_qc_t]) 220 ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [ 221 AC_MSG_RESULT(yes) 222 AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t, 223 [make_request_fn() return type]) 224 AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1, 225 [Noting that make_request_fn() ] 226 [returns blk_qc_t]) 227 ],[ 228 ZFS_LINUX_TEST_ERROR([make_request_fn]) 229 ]) 230 ]) 231 ]) 232 ]) 233 ]) 234]) 235