summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorYunlei He <heyunlei@huawei.com>2018-11-06 05:25:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-20 12:08:57 +0300
commit88331aa2d322acfff1148974de67de057e793d8c (patch)
treee9f97fd779d7075361e60d911c17bb024477b545 /fs
parentd31660b9452e40c10fc5f22b67ef7b47126f8c9a (diff)
downloadlinux-88331aa2d322acfff1148974de67de057e793d8c.tar.xz
f2fs: move dir data flush to write checkpoint process
[ Upstream commit b61ac5b720146c619c7cdf17eff2551b934399e5 ] This patch move dir data flush to write checkpoint process, by doing this, it may reduce some time for dir fsync. pre: -f2fs_do_sync_file enter -file_write_and_wait_range <- flush & wait -write_checkpoint -do_checkpoint <- wait all -f2fs_do_sync_file exit now: -f2fs_do_sync_file enter -write_checkpoint -block_operations <- flush dir & no wait -do_checkpoint <- wait all -f2fs_do_sync_file exit Signed-off-by: Yunlei He <heyunlei@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 8e68bb64f835..c4ba75acc6e2 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -153,6 +153,9 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
trace_f2fs_sync_file_enter(inode);
+ if (S_ISDIR(inode->i_mode))
+ goto go_write;
+
/* if fdatasync is triggered, let's do in-place-update */
if (get_dirty_pages(inode) <= SM_I(sbi)->min_fsync_blocks)
set_inode_flag(fi, FI_NEED_IPU);