[v2,2/2] block: make function 'kill_bdev' static
diff mbox series

Message ID 20200530114032.125678-3-zhengbin13@huawei.com
State New
Headers show
Series
  • loop: replace kill_bdev with invalidate_bdev
Related show

Commit Message

Zhengbin (OSKernel) May 30, 2020, 11:40 a.m. UTC
kill_bdev does not have any external user, so make it static.

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 fs/block_dev.c     | 5 ++---
 include/linux/fs.h | 2 --
 2 files changed, 2 insertions(+), 5 deletions(-)

--
2.21.3

Comments

Christoph Hellwig May 30, 2020, 11:36 a.m. UTC | #1
On Sat, May 30, 2020 at 07:40:32PM +0800, Zheng Bin wrote:
> kill_bdev does not have any external user, so make it static.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Bart Van Assche June 18, 2020, 2:13 a.m. UTC | #2
On 2020-05-30 04:40, Zheng Bin wrote:
> kill_bdev does not have any external user, so make it static.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

Patch
diff mbox series

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 93672c3f1c78..2396ebd014ba 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -75,7 +75,7 @@  static void bdev_write_inode(struct block_device *bdev)
 }

 /* Kill _all_ buffers and pagecache , dirty or not.. */
-void kill_bdev(struct block_device *bdev)
+static void kill_bdev(struct block_device *bdev)
 {
 	struct address_space *mapping = bdev->bd_inode->i_mapping;

@@ -84,8 +84,7 @@  void kill_bdev(struct block_device *bdev)

 	invalidate_bh_lrus();
 	truncate_inode_pages(mapping, 0);
-}	
-EXPORT_SYMBOL(kill_bdev);
+}

 /* Invalidate clean unused buffers and pagecache. */
 void invalidate_bdev(struct block_device *bdev)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 45cc10cdf6dd..d0ad120298be 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2590,7 +2590,6 @@  extern void bdput(struct block_device *);
 extern void invalidate_bdev(struct block_device *);
 extern void iterate_bdevs(void (*)(struct block_device *, void *), void *);
 extern int sync_blockdev(struct block_device *bdev);
-extern void kill_bdev(struct block_device *);
 extern struct super_block *freeze_bdev(struct block_device *);
 extern void emergency_thaw_all(void);
 extern void emergency_thaw_bdev(struct super_block *sb);
@@ -2606,7 +2605,6 @@  static inline bool sb_is_blkdev_sb(struct super_block *sb)
 #else
 static inline void bd_forget(struct inode *inode) {}
 static inline int sync_blockdev(struct block_device *bdev) { return 0; }
-static inline void kill_bdev(struct block_device *bdev) {}
 static inline void invalidate_bdev(struct block_device *bdev) {}

 static inline struct super_block *freeze_bdev(struct block_device *sb)