summaryrefslogtreecommitdiff
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2024-02-29 17:38:38 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2024-03-26 05:13:08 +0300
commitee745e4736fbf33079d0d0808e1343c2280fd59a (patch)
tree99a73f8a46c53540a2396d0b8aa27b68a4bf2b8b /fs/f2fs/super.c
parent928a87efa42302a23bb9554be081a28058495f22 (diff)
downloadlinux-ee745e4736fbf33079d0d0808e1343c2280fd59a.tar.xz
f2fs: support .shutdown in f2fs_sops
Support .shutdown callback in f2fs_sops, then, it can be called to shut down the file system when underlying block device is marked dead. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index a6867f26f141..7c45929671ad 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -2547,6 +2547,11 @@ restore_opts:
return err;
}
+static void f2fs_shutdown(struct super_block *sb)
+{
+ f2fs_do_shutdown(F2FS_SB(sb), F2FS_GOING_DOWN_NOSYNC, false);
+}
+
#ifdef CONFIG_QUOTA
static bool f2fs_need_recovery(struct f2fs_sb_info *sbi)
{
@@ -3146,6 +3151,7 @@ static const struct super_operations f2fs_sops = {
.unfreeze_fs = f2fs_unfreeze,
.statfs = f2fs_statfs,
.remount_fs = f2fs_remount,
+ .shutdown = f2fs_shutdown,
};
#ifdef CONFIG_FS_ENCRYPTION