HomeFreeBSD

zvol_os: fix compile with blk-mq on Linux 4.x

Description

zvol_os: fix compile with blk-mq on Linux 4.x

99741bde5 accesses a cached blk-mq hardware context through the mq_hctx
field of struct request. However, this field did not exist until 5.0.
Before that, the private function blk_mq_map_queue() was used to dig it
out of broader queue context. This commit detects this situation, and
handles it with a poor-man's simulation of that function.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16069

Details

Provenance
rob.norris_klarasystems.comAuthored on Apr 8 2024, 6:38 PM
Tony Hutter <hutter2@llnl.gov>Committed on Apr 17 2024, 5:10 PM
Parents
rG5c0fe099ec74: zvol_os: fix build on Linux <3.13
Branches
Unknown
Tags
Unknown