summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2024-01-23 16:26:44 +0300
committerChristian Brauner <brauner@kernel.org>2024-02-25 14:05:27 +0300
commite97d06a46526d9392cbdbd7eda193091e1af2723 (patch)
tree715518cfe50bcbf01d7d14d688fef4e32bcbb6ed /block
parent9de31ee6d7a8be42d9984bd5cff66bcd7c259a7a (diff)
downloadlinux-e97d06a46526d9392cbdbd7eda193091e1af2723.tar.xz
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>
Diffstat (limited to 'block')
-rw-r--r--block/bdev.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/block/bdev.c b/block/bdev.c
index e1149652c532..4003f8e1782a 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -1004,46 +1004,6 @@ struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
}
EXPORT_SYMBOL(bdev_file_open_by_path);
-/**
- * bdev_open_by_path - open a block device by name
- * @path: path to the block device to open
- * @mode: open mode (BLK_OPEN_*)
- * @holder: exclusive holder identifier
- * @hops: holder operations
- *
- * Open the block device described by the device file at @path. If @holder is
- * not %NULL, the block device is opened with exclusive access. Exclusive opens
- * may nest for the same @holder.
- *
- * CONTEXT:
- * Might sleep.
- *
- * RETURNS:
- * Handle with a reference to the block_device on success, ERR_PTR(-errno) on
- * failure.
- */
-struct bdev_handle *bdev_open_by_path(const char *path, blk_mode_t mode,
- void *holder, const struct blk_holder_ops *hops)
-{
- struct bdev_handle *handle;
- dev_t dev;
- int error;
-
- error = lookup_bdev(path, &dev);
- if (error)
- return ERR_PTR(error);
-
- handle = bdev_open_by_dev(dev, mode, holder, hops);
- if (!IS_ERR(handle) && (mode & BLK_OPEN_WRITE) &&
- bdev_read_only(handle->bdev)) {
- bdev_release(handle);
- return ERR_PTR(-EACCES);
- }
-
- return handle;
-}
-EXPORT_SYMBOL(bdev_open_by_path);
-
void bdev_release(struct bdev_handle *handle)
{
struct block_device *bdev = handle->bdev;