diff mbox series

block: unexport truncate_bdev_range

Message ID 20210109111332.1132424-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series block: unexport truncate_bdev_range | expand

Commit Message

Christoph Hellwig Jan. 9, 2021, 11:13 a.m. UTC
truncate_bdev_range is only used in always built-in block layer code,
so remove the export and the !CONFIG_BLOCK stub.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/block_dev.c         | 1 -
 include/linux/blkdev.h | 9 ++-------
 2 files changed, 2 insertions(+), 8 deletions(-)

Comments

Christoph Hellwig Jan. 25, 2021, 8:20 a.m. UTC | #1
Jens,

can you pick this one up?

On Sat, Jan 09, 2021 at 12:13:32PM +0100, Christoph Hellwig wrote:
> truncate_bdev_range is only used in always built-in block layer code,
> so remove the export and the !CONFIG_BLOCK stub.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/block_dev.c         | 1 -
>  include/linux/blkdev.h | 9 ++-------
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 3e5b02f6606c42..41a9b0cb2d8a16 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -126,7 +126,6 @@ int truncate_bdev_range(struct block_device *bdev, fmode_t mode,
>  		bd_abort_claiming(bdev, truncate_bdev_range);
>  	return 0;
>  }
> -EXPORT_SYMBOL(truncate_bdev_range);
>  
>  static void set_init_blocksize(struct block_device *bdev)
>  {
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index f94ee3089e015e..22fc4f3141d555 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -2012,21 +2012,16 @@ void bdev_add(struct block_device *bdev, dev_t dev);
>  struct block_device *I_BDEV(struct inode *inode);
>  struct block_device *bdgrab(struct block_device *bdev);
>  void bdput(struct block_device *);
> +int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
> +		loff_t lend);
>  
>  #ifdef CONFIG_BLOCK
>  void invalidate_bdev(struct block_device *bdev);
> -int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
> -			loff_t lend);
>  int sync_blockdev(struct block_device *bdev);
>  #else
>  static inline void invalidate_bdev(struct block_device *bdev)
>  {
>  }
> -static inline int truncate_bdev_range(struct block_device *bdev, fmode_t mode,
> -				      loff_t lstart, loff_t lend)
> -{
> -	return 0;
> -}
>  static inline int sync_blockdev(struct block_device *bdev)
>  {
>  	return 0;
> -- 
> 2.29.2
---end quoted text---
Jens Axboe Jan. 26, 2021, 8:14 p.m. UTC | #2
On 1/9/21 4:13 AM, Christoph Hellwig wrote:
> truncate_bdev_range is only used in always built-in block layer code,
> so remove the export and the !CONFIG_BLOCK stub.

Applied, thanks.
diff mbox series

Patch

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 3e5b02f6606c42..41a9b0cb2d8a16 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -126,7 +126,6 @@  int truncate_bdev_range(struct block_device *bdev, fmode_t mode,
 		bd_abort_claiming(bdev, truncate_bdev_range);
 	return 0;
 }
-EXPORT_SYMBOL(truncate_bdev_range);
 
 static void set_init_blocksize(struct block_device *bdev)
 {
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f94ee3089e015e..22fc4f3141d555 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -2012,21 +2012,16 @@  void bdev_add(struct block_device *bdev, dev_t dev);
 struct block_device *I_BDEV(struct inode *inode);
 struct block_device *bdgrab(struct block_device *bdev);
 void bdput(struct block_device *);
+int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
+		loff_t lend);
 
 #ifdef CONFIG_BLOCK
 void invalidate_bdev(struct block_device *bdev);
-int truncate_bdev_range(struct block_device *bdev, fmode_t mode, loff_t lstart,
-			loff_t lend);
 int sync_blockdev(struct block_device *bdev);
 #else
 static inline void invalidate_bdev(struct block_device *bdev)
 {
 }
-static inline int truncate_bdev_range(struct block_device *bdev, fmode_t mode,
-				      loff_t lstart, loff_t lend)
-{
-	return 0;
-}
 static inline int sync_blockdev(struct block_device *bdev)
 {
 	return 0;