[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221027120807.6337-2-frank.li@vivo.com>
Date: Thu, 27 Oct 2022 20:08:06 +0800
From: Yangtao Li <frank.li@...o.com>
To: jaegeuk@...nel.org, chao@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, Yangtao Li <frank.li@...o.com>
Subject: [PATCH 2/3] f2fs: export f2fs_stop_flush_thread() for external use
Need to stop the flush thread running externally,
so export it.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
fs/f2fs/f2fs.h | 1 +
fs/f2fs/segment.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index b467c0ca1118..0d072b029187 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3732,6 +3732,7 @@ unsigned int f2fs_usable_segs_in_sec(struct f2fs_sb_info *sbi,
unsigned int segno);
unsigned int f2fs_usable_blks_in_seg(struct f2fs_sb_info *sbi,
unsigned int segno);
+void f2fs_stop_flush_thread(struct f2fs_sb_info *sbi);
#define DEF_FRAGMENT_SIZE 4
#define MIN_FRAGMENT_SIZE 1
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 282616e6852a..f0f52979397e 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -671,7 +671,7 @@ int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi)
return 0;
}
-void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free)
+void f2fs_stop_flush_thread(struct f2fs_sb_info *sbi)
{
struct flush_cmd_control *fcc = SM_I(sbi)->fcc_info;
@@ -681,6 +681,13 @@ void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free)
fcc->f2fs_issue_flush = NULL;
kthread_stop(flush_thread);
}
+}
+
+void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free)
+{
+ struct flush_cmd_control *fcc = SM_I(sbi)->fcc_info;
+
+ f2fs_stop_flush_thread(sbi);
if (free) {
kfree(fcc);
SM_I(sbi)->fcc_info = NULL;
--
2.25.1
Powered by blists - more mailing lists