public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: export symbol blk_flush_plug
@ 2023-09-04  4:22 Chunhai Guo
  2023-09-04  6:15 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Chunhai Guo @ 2023-09-04  4:22 UTC (permalink / raw)
  To: axboe
  Cc: chao, jaegeuk, linux-block, linux-kernel, Chunhai Guo,
	kernel test robot

blk_flush_plug() can be used in a filesystem module, without it may cause
a link failure, as shown in the reported test.

ERROR: modpost: "__blk_flush_plug" [fs/f2fs/f2fs.ko] undefined!

Export the symbol so it can be used by filesystem module.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309021523.UcS7T7mp-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202309021427.K1P8kWbl-lkp@intel.com/
Fixes: e1e9b8062c74 ("f2fs: replace blk_finish_plug() with blk_flush_plug()")
Signed-off-by: Chunhai Guo <guochunhai@vivo.com>
---
 block/blk-core.c       | 7 +++++++
 include/linux/blkdev.h | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 99d8b9812b18..1c5e5d3406fe 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1156,6 +1156,13 @@ void __blk_flush_plug(struct blk_plug *plug, bool from_schedule)
 		blk_mq_free_plug_rqs(plug);
 }
 
+void blk_flush_plug(struct blk_plug *plug, bool async)
+{
+	if (plug)
+		__blk_flush_plug(plug, async);
+}
+EXPORT_SYMBOL(blk_flush_plug);
+
 /**
  * blk_finish_plug - mark the end of a batch of submitted I/O
  * @plug:	The &struct blk_plug passed to blk_start_plug()
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ed44a997f629..26ff9d417e6e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -986,13 +986,7 @@ extern struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug,
 extern void blk_start_plug(struct blk_plug *);
 extern void blk_start_plug_nr_ios(struct blk_plug *, unsigned short);
 extern void blk_finish_plug(struct blk_plug *);
-
-void __blk_flush_plug(struct blk_plug *plug, bool from_schedule);
-static inline void blk_flush_plug(struct blk_plug *plug, bool async)
-{
-	if (plug)
-		__blk_flush_plug(plug, async);
-}
+extern void blk_flush_plug(struct blk_plug *plug, bool async);
 
 int blkdev_issue_flush(struct block_device *bdev);
 long nr_blockdev_pages(void);
-- 
2.25.1


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

end of thread, other threads:[~2023-09-04  8:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-04  4:22 [PATCH] block: export symbol blk_flush_plug Chunhai Guo
2023-09-04  6:15 ` Christoph Hellwig
2023-09-04  7:24   ` Chunhai Guo
2023-09-04  7:34     ` Christoph Hellwig
2023-09-04  8:10       ` Chunhai Guo

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