HomeFreeBSD

Linux 6.5 compat: blkdev changes

Description

Linux 6.5 compat: blkdev changes

Multiple changes to the blkdev API were introduced in Linux 6.5. This
includes passing (void* holder) to blkdev_put, adding a new
blk_holder_ops* arg to blkdev_get_by_path, adding a new blk_mode_t type
that replaces uses of fmode_t, and removing an argument from the release
handler on block_device_operations that we weren't using. The open
function definition has also changed to take gendisk* and blk_mode_t, so
update it accordingly, too.

Implement local wrappers for blkdev_get_by_path() and
vdev_blkdev_put() so that the in-line calls are cleaner, and place the
conditionally-compiled implementation details inside of both of these
local wrappers. Both calls are exclusively used within vdev_disk.c, at
this time.

Add blk_mode_is_open_write() to test FMODE_WRITE / BLK_OPEN_WRITE
The wrapper function is now used for testing using the appropriate
method for the kernel, whether the open mode is writable or not.

Emphasize fmode_t arg in zvol_release is not used

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #15099

Details

Provenance
Coleman Kane <ckane@colemankane.org>Authored on Aug 1 2023, 3:37 PM
Tony Hutter <hutter2@llnl.gov>Committed on Sep 11 2023, 11:20 PM
Parents
rG3ff9e4f8ac23: Linux 6.5 compat: use disk_check_media_change when it exists
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rG7c0618bdb731: Linux 6.5 compat: blkdev changes (authored by Coleman Kane <ckane@colemankane.org>).Sep 11 2023, 11:20 PM