From: Hoegeun Kwon Date: Mon, 17 Oct 2022 08:27:32 +0000 (+0900) Subject: block: make function 'kill_bdev' export X-Git-Tag: accepted/tizen/unified/20230814.120944~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d21eb57e2e22c1fa4a1bf7be86636501e4441dd0;p=platform%2Fkernel%2Flinux-rpi.git block: make function 'kill_bdev' export 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 --- diff --git a/block/bdev.c b/block/bdev.c index 18abafb..d0d5a42 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -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) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 67344df..cf64df9 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -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);