block: make function 'kill_bdev' export
authorHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 17 Oct 2022 08:27:32 +0000 (17:27 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Wed, 23 Nov 2022 02:23:53 +0000 (11:23 +0900)
Revert "block: make function 'kill_bdev' static" with Kernel v5.15.
  :This reverts commit 3373a3461aa15b7f9a871fa4cb2c9ef21ac20b47.

To free ramdisk memory, BLKFLSBUF support is required.

Change-Id: I55831bc50d8a7344a873172f2f7498d2a0e37786
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
block/bdev.c
include/linux/blkdev.h

index 18abafb..d0d5a42 100644 (file)
@@ -66,7 +66,7 @@ static void bdev_write_inode(struct block_device *bdev)
 }
 
 /* Kill _all_ buffers and pagecache , dirty or not.. */
-static void kill_bdev(struct block_device *bdev)
+void kill_bdev(struct block_device *bdev)
 {
        struct address_space *mapping = bdev->bd_inode->i_mapping;
 
@@ -76,6 +76,7 @@ static 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)
index 67344df..cf64df9 100644 (file)
@@ -2010,6 +2010,7 @@ void invalidate_bdev(struct block_device *bdev);
 int sync_blockdev(struct block_device *bdev);
 int sync_blockdev_nowait(struct block_device *bdev);
 void sync_bdevs(bool wait);
+void kill_bdev(struct block_device *bdev);
 #else
 static inline void invalidate_bdev(struct block_device *bdev)
 {
@@ -2025,6 +2026,9 @@ static inline int sync_blockdev_nowait(struct block_device *bdev)
 static inline void sync_bdevs(bool wait)
 {
 }
+static inline void kill_bdev(struct block_device *bdev)
+{
+}
 #endif
 int fsync_bdev(struct block_device *bdev);