f2fs: move dir data flush to write checkpoint process
authorYunlei He <heyunlei@huawei.com>
Tue, 6 Nov 2018 02:25:29 +0000 (10:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:00 +0000 (19:46 +0100)
commit1449abc3a84ea1b291d46d8dc0255dadda87a60b
treeb5db560cdb4ed9978bee86a3f13428c447ad9d10
parent84e4e56c9a385b7a1fa1e683f6525391c2cd00f3
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>
fs/f2fs/file.c