mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
c0f075c06b
commit
d76de9fb17
@@ -398,6 +398,12 @@ vdev_lookup_bdev(const char *path, dev_t *dev)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(HAVE_BLK_MODE_T)
|
||||
#define blk_mode_is_open_write(flag) ((flag) & BLK_OPEN_WRITE)
|
||||
#else
|
||||
#define blk_mode_is_open_write(flag) ((flag) & FMODE_WRITE)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Kernels without bio_set_op_attrs use bi_rw for the bio flags.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user