diff options
author | Junling Zheng <zhengjunling@huawei.com> | 2018-03-07 12:07:49 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-03-17 13:57:28 +0900 |
commit | 93cf93f17c8ef7c03d828914eaef88d8e585490d (patch) | |
tree | c6b82ef66fd921f65c8b15dade3dec74395d09db /fs/f2fs/f2fs.h | |
parent | eea52882d848827ca812282118cd17025a76a891 (diff) | |
download | op-kernel-dev-93cf93f17c8ef7c03d828914eaef88d8e585490d.zip op-kernel-dev-93cf93f17c8ef7c03d828914eaef88d8e585490d.tar.gz |
f2fs: introduce mount option for fsync mode
Commit "0a007b97aad6"(f2fs: recover directory operations by fsync)
fixed xfstest generic/342 case, but it also increased the written
data and caused the performance degradation. In most cases, there's
no need to do so heavy fsync actually.
So we introduce new mount option "fsync_mode={posix,strict}" to
control the policy of fsync. "fsync_mode=posix" is set by default,
and means that f2fs uses a light fsync, which follows POSIX semantics.
And "fsync_mode=strict" means that it's a heavy fsync, which behaves
in line with xfs, ext4 and btrfs, where generic/342 will pass, but
the performance will regress.
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 0e47fe9..3c79b35 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1052,6 +1052,11 @@ enum { ALLOC_MODE_REUSE, /* reuse segments as much as possible */ }; +enum fsync_mode { + FSYNC_MODE_POSIX, /* fsync follows posix semantics */ + FSYNC_MODE_STRICT, /* fsync behaves in line with ext4 */ +}; + struct f2fs_sb_info { struct super_block *sb; /* pointer to VFS super block */ struct proc_dir_entry *s_proc; /* proc entry */ @@ -1241,6 +1246,9 @@ struct f2fs_sb_info { /* segment allocation policy */ int alloc_mode; + + /* fsync policy */ + int fsync_mode; }; #ifdef CONFIG_F2FS_FAULT_INJECTION |