From: Yunlei He Date: Tue, 6 Nov 2018 02:25:29 +0000 (+0800) Subject: f2fs: move dir data flush to write checkpoint process X-Git-Tag: v5.4-rc1~1912^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b61ac5b720146c619c7cdf17eff2551b934399e5;p=platform%2Fkernel%2Flinux-rpi.git f2fs: move dir data flush to write checkpoint process 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 Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index c25228a1593c..439d340dbe1a 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -216,6 +216,9 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end, 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 (datasync || get_dirty_pages(inode) <= SM_I(sbi)->min_fsync_blocks) set_inode_flag(inode, FI_NEED_IPU);