public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: unexport truncate_bdev_range
@ 2021-01-09 11:13 Christoph Hellwig
  2021-01-25  8:20 ` Christoph Hellwig
  2021-01-26 20:14 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-01-09 11:13 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: unexport truncate_bdev_range
  2021-01-09 11:13 [PATCH] block: unexport truncate_bdev_range Christoph Hellwig
@ 2021-01-25  8:20 ` Christoph Hellwig
  2021-01-26 20:14 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-01-25  8:20 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

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---

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] block: unexport truncate_bdev_range
  2021-01-09 11:13 [PATCH] block: unexport truncate_bdev_range Christoph Hellwig
  2021-01-25  8:20 ` Christoph Hellwig
@ 2021-01-26 20:14 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-01-26 20:14 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block

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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-26 22:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-09 11:13 [PATCH] block: unexport truncate_bdev_range Christoph Hellwig
2021-01-25  8:20 ` Christoph Hellwig
2021-01-26 20:14 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox