]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bdev: remove bdev_open_by_path()
authorChristian Brauner <brauner@kernel.org>
Tue, 23 Jan 2024 13:26:44 +0000 (14:26 +0100)
committerChristian Brauner <brauner@kernel.org>
Sun, 25 Feb 2024 11:05:27 +0000 (12:05 +0100)
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>
block/bdev.c
include/linux/blkdev.h

index e1149652c53285d7483318b3d367e762d7bf79c0..4003f8e1782a48b1e3e8667dfdb9835775930a35 100644 (file)
@@ -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;
index 76706aa473163dd573a3da1418993ea03d193c73..5880d5abfebe915bf21763a2c4b664888c2f6a4a 100644 (file)
@@ -1484,8 +1484,6 @@ struct bdev_handle {
 
 struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
                const struct blk_holder_ops *hops);
-struct bdev_handle *bdev_open_by_path(const char *path, blk_mode_t mode,
-               void *holder, const struct blk_holder_ops *hops);
 struct file *bdev_file_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
                const struct blk_holder_ops *hops);
 struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,