]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/f2fs-move-dir-data-flush-to-write-checkpoint-process.patch
autosel patches for 4.14
[thirdparty/kernel/stable-queue.git] / queue-4.14 / f2fs-move-dir-data-flush-to-write-checkpoint-process.patch
1 From 5641cdf29b90a83166aab8bc4f97b39df59d9359 Mon Sep 17 00:00:00 2001
2 From: Yunlei He <heyunlei@huawei.com>
3 Date: Tue, 6 Nov 2018 10:25:29 +0800
4 Subject: f2fs: move dir data flush to write checkpoint process
5
6 [ Upstream commit b61ac5b720146c619c7cdf17eff2551b934399e5 ]
7
8 This patch move dir data flush to write checkpoint process, by
9 doing this, it may reduce some time for dir fsync.
10
11 pre:
12 -f2fs_do_sync_file enter
13 -file_write_and_wait_range <- flush & wait
14 -write_checkpoint
15 -do_checkpoint <- wait all
16 -f2fs_do_sync_file exit
17
18 now:
19 -f2fs_do_sync_file enter
20 -write_checkpoint
21 -block_operations <- flush dir & no wait
22 -do_checkpoint <- wait all
23 -f2fs_do_sync_file exit
24
25 Signed-off-by: Yunlei He <heyunlei@huawei.com>
26 Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
27 Signed-off-by: Sasha Levin <sashal@kernel.org>
28 ---
29 fs/f2fs/file.c | 3 +++
30 1 file changed, 3 insertions(+)
31
32 diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
33 index 7d3189f1941c..5f549bc4e097 100644
34 --- a/fs/f2fs/file.c
35 +++ b/fs/f2fs/file.c
36 @@ -205,6 +205,9 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
37
38 trace_f2fs_sync_file_enter(inode);
39
40 + if (S_ISDIR(inode->i_mode))
41 + goto go_write;
42 +
43 /* if fdatasync is triggered, let's do in-place-update */
44 if (datasync || get_dirty_pages(inode) <= SM_I(sbi)->min_fsync_blocks)
45 set_inode_flag(inode, FI_NEED_IPU);
46 --
47 2.19.1
48