Commit a499181
tests/python: fix blk request probes tests
Linux kernel commit f3fa33acca9f ("block: remove the ->rq_disk field in
struct request") dropped rq_disk in favor of rq->q->disk. The clang
tests still include <linux/blkdev.h> and read rq->rq_disk, which fails
on recent kernels.
16: include/linux/blkdev.h:34:8: note: forward declaration of 'struct request'
16: struct request;
16: ^
16: /virtual/main.c:15:12: error: incomplete definition of type 'struct request'
16: if (!rq->rq_disk || rq->rq_disk->major != 5 ||
16: ~~^
Since blk-mq became default in linux 5.x, this commit includes
<linux/blk-mq.h> and fetch the disk via rq->q->disk so the tests stay
valid on current kernels.
Signed-off-by: Hoyeon Lee <hoyeon.lee@suse.com>1 parent 2232b7e commit a499181
1 file changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | | - | |
| 233 | + | |
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
| |||
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| 320 | + | |
318 | 321 | | |
319 | | - | |
| 322 | + | |
320 | 323 | | |
321 | | - | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| |||
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
| 476 | + | |
473 | 477 | | |
474 | 478 | | |
475 | | - | |
| 479 | + | |
476 | 480 | | |
477 | 481 | | |
478 | 482 | | |
| |||
1294 | 1298 | | |
1295 | 1299 | | |
1296 | 1300 | | |
1297 | | - | |
| 1301 | + | |
1298 | 1302 | | |
1299 | 1303 | | |
1300 | 1304 | | |
1301 | | - | |
| 1305 | + | |
1302 | 1306 | | |
1303 | 1307 | | |
1304 | 1308 | | |
1305 | 1309 | | |
1306 | 1310 | | |
1307 | 1311 | | |
1308 | 1312 | | |
| 1313 | + | |
1309 | 1314 | | |
1310 | 1315 | | |
1311 | 1316 | | |
1312 | 1317 | | |
1313 | | - | |
1314 | | - | |
| 1318 | + | |
1315 | 1319 | | |
1316 | 1320 | | |
1317 | 1321 | | |
| |||
0 commit comments