]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
block: Use bdev_open_by_dev() in blkdev_open()
authorJan Kara <jack@suse.cz>
Wed, 27 Sep 2023 09:34:08 +0000 (11:34 +0200)
committerChristian Brauner <brauner@kernel.org>
Sat, 28 Oct 2023 11:29:16 +0000 (13:29 +0200)
commit841dd789b8625eb9288aaa2be9f10872e6622033
tree68ccf22ca8afac4616f8135532e6ad52d12118c9
parente719b4d156749f02eafed31a3c515f2aa9dcc72a
block: Use bdev_open_by_dev() in blkdev_open()

Convert blkdev_open() to use bdev_open_by_dev(). To be able to propagate
handle from blkdev_open() to blkdev_release() we need to stop using
existence of file->private_data to determine exclusive block device
opens. Use bdev_handle->mode for this purpose since file->f_flags
isn't usable for this (O_EXCL is cleared from the flags during open).

Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230927093442.25915-2-jack@suse.cz
Signed-off-by: Christian Brauner <brauner@kernel.org>
block/bdev.c
block/fops.c
include/linux/blkdev.h