Skip to content

Commit e97d06a

Browse files
committed
bdev: remove bdev_open_by_path()
Link: https://lore.kernel.org/r/20240123-vfs-bdev-file-v2-27-adbd023e19cc@kernel.org Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 9de31ee commit e97d06a

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

block/bdev.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,46 +1004,6 @@ struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
10041004
}
10051005
EXPORT_SYMBOL(bdev_file_open_by_path);
10061006

1007-
/**
1008-
* bdev_open_by_path - open a block device by name
1009-
* @path: path to the block device to open
1010-
* @mode: open mode (BLK_OPEN_*)
1011-
* @holder: exclusive holder identifier
1012-
* @hops: holder operations
1013-
*
1014-
* Open the block device described by the device file at @path. If @holder is
1015-
* not %NULL, the block device is opened with exclusive access. Exclusive opens
1016-
* may nest for the same @holder.
1017-
*
1018-
* CONTEXT:
1019-
* Might sleep.
1020-
*
1021-
* RETURNS:
1022-
* Handle with a reference to the block_device on success, ERR_PTR(-errno) on
1023-
* failure.
1024-
*/
1025-
struct bdev_handle *bdev_open_by_path(const char *path, blk_mode_t mode,
1026-
void *holder, const struct blk_holder_ops *hops)
1027-
{
1028-
struct bdev_handle *handle;
1029-
dev_t dev;
1030-
int error;
1031-
1032-
error = lookup_bdev(path, &dev);
1033-
if (error)
1034-
return ERR_PTR(error);
1035-
1036-
handle = bdev_open_by_dev(dev, mode, holder, hops);
1037-
if (!IS_ERR(handle) && (mode & BLK_OPEN_WRITE) &&
1038-
bdev_read_only(handle->bdev)) {
1039-
bdev_release(handle);
1040-
return ERR_PTR(-EACCES);
1041-
}
1042-
1043-
return handle;
1044-
}
1045-
EXPORT_SYMBOL(bdev_open_by_path);
1046-
10471007
void bdev_release(struct bdev_handle *handle)
10481008
{
10491009
struct block_device *bdev = handle->bdev;

include/linux/blkdev.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,8 +1484,6 @@ struct bdev_handle {
14841484

14851485
struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
14861486
const struct blk_holder_ops *hops);
1487-
struct bdev_handle *bdev_open_by_path(const char *path, blk_mode_t mode,
1488-
void *holder, const struct blk_holder_ops *hops);
14891487
struct file *bdev_file_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
14901488
const struct blk_holder_ops *hops);
14911489
struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,

0 commit comments

Comments
 (0)