diff mbox series

[v2,28/34] bdev: make bdev_release() private to block layer

Message ID 20240123-vfs-bdev-file-v2-28-adbd023e19cc@kernel.org (mailing list archive)
State New, archived
Headers show
Series Open block devices as files | expand

Commit Message

Christian Brauner Jan. 23, 2024, 1:26 p.m. UTC
and move both of them to the private block header. There's no caller in
the tree anymore that uses them directly.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 block/bdev.c           | 2 --
 block/blk.h            | 4 ++++
 include/linux/blkdev.h | 3 ---
 3 files changed, 4 insertions(+), 5 deletions(-)

Comments

Christoph Hellwig Jan. 29, 2024, 4:19 p.m. UTC | #1
On Tue, Jan 23, 2024 at 02:26:45PM +0100, Christian Brauner wrote:
> and move both of them to the private block header. There's no caller in
> the tree anymore that uses them directly.

the subject only takes about a single helper, but then the commit
message mentions "both".  Seems like the subject is missing a
"bdev_open_by_dev and".

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Jan Kara Feb. 1, 2024, 10:26 a.m. UTC | #2
On Tue 23-01-24 14:26:45, Christian Brauner wrote:
> and move both of them to the private block header. There's no caller in
> the tree anymore that uses them directly.
> 
> Signed-off-by: Christian Brauner <brauner@kernel.org>

As Christoph noticed, the changelog needs a bit of work but otherwise feel
free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
> ---
>  block/bdev.c           | 2 --
>  block/blk.h            | 4 ++++
>  include/linux/blkdev.h | 3 ---
>  3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/block/bdev.c b/block/bdev.c
> index eb5607af6ec5..1f64f213c5fa 100644
> --- a/block/bdev.c
> +++ b/block/bdev.c
> @@ -916,7 +916,6 @@ struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
>  	kfree(handle);
>  	return ERR_PTR(ret);
>  }
> -EXPORT_SYMBOL(bdev_open_by_dev);
>  
>  static unsigned blk_to_file_flags(blk_mode_t mode)
>  {
> @@ -1045,7 +1044,6 @@ void bdev_release(struct bdev_handle *handle)
>  	blkdev_put_no_open(bdev);
>  	kfree(handle);
>  }
> -EXPORT_SYMBOL(bdev_release);
>  
>  /**
>   * lookup_bdev() - Look up a struct block_device by name.
> diff --git a/block/blk.h b/block/blk.h
> index 1ef920f72e0f..c9630774767d 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -516,4 +516,8 @@ static inline int req_ref_read(struct request *req)
>  	return atomic_read(&req->ref);
>  }
>  
> +void bdev_release(struct bdev_handle *handle);
> +struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
> +		const struct blk_holder_ops *hops);
> +
>  #endif /* BLK_INTERNAL_H */
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 5880d5abfebe..495f55587207 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1482,8 +1482,6 @@ struct bdev_handle {
>  	blk_mode_t mode;
>  };
>  
> -struct bdev_handle *bdev_open_by_dev(dev_t dev, 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,
> @@ -1491,7 +1489,6 @@ struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
>  int bd_prepare_to_claim(struct block_device *bdev, void *holder,
>  		const struct blk_holder_ops *hops);
>  void bd_abort_claiming(struct block_device *bdev, void *holder);
> -void bdev_release(struct bdev_handle *handle);
>  
>  /* just for blk-cgroup, don't use elsewhere */
>  struct block_device *blkdev_get_no_open(dev_t dev);
> 
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/block/bdev.c b/block/bdev.c
index eb5607af6ec5..1f64f213c5fa 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -916,7 +916,6 @@  struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
 	kfree(handle);
 	return ERR_PTR(ret);
 }
-EXPORT_SYMBOL(bdev_open_by_dev);
 
 static unsigned blk_to_file_flags(blk_mode_t mode)
 {
@@ -1045,7 +1044,6 @@  void bdev_release(struct bdev_handle *handle)
 	blkdev_put_no_open(bdev);
 	kfree(handle);
 }
-EXPORT_SYMBOL(bdev_release);
 
 /**
  * lookup_bdev() - Look up a struct block_device by name.
diff --git a/block/blk.h b/block/blk.h
index 1ef920f72e0f..c9630774767d 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -516,4 +516,8 @@  static inline int req_ref_read(struct request *req)
 	return atomic_read(&req->ref);
 }
 
+void bdev_release(struct bdev_handle *handle);
+struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
+		const struct blk_holder_ops *hops);
+
 #endif /* BLK_INTERNAL_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5880d5abfebe..495f55587207 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1482,8 +1482,6 @@  struct bdev_handle {
 	blk_mode_t mode;
 };
 
-struct bdev_handle *bdev_open_by_dev(dev_t dev, 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,
@@ -1491,7 +1489,6 @@  struct file *bdev_file_open_by_path(const char *path, blk_mode_t mode,
 int bd_prepare_to_claim(struct block_device *bdev, void *holder,
 		const struct blk_holder_ops *hops);
 void bd_abort_claiming(struct block_device *bdev, void *holder);
-void bdev_release(struct bdev_handle *handle);
 
 /* just for blk-cgroup, don't use elsewhere */
 struct block_device *blkdev_get_no_open(dev_t dev);