aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2018-06-28 19:34:40 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2018-07-11 19:54:51 -0700
commit7f2ecdd837ae0a27149a0387b2534e11d955c5f8 (patch)
tree726673a06e25d7c029612370eeb4d5799776672c /fs/f2fs/node.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (diff)
downloadlinux-dev-7f2ecdd837ae0a27149a0387b2534e11d955c5f8.tar.xz
linux-dev-7f2ecdd837ae0a27149a0387b2534e11d955c5f8.zip
f2fs: flush journal nat entries for nat_bits during unmount
Let's flush journal nat entries for speed up in the next run. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 10643b11bd59..b0267d3823b4 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2582,6 +2582,13 @@ void f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
nid_t set_idx = 0;
LIST_HEAD(sets);
+ /* during unmount, let's flush nat_bits before checking dirty_nat_cnt */
+ if (enabled_nat_bits(sbi, cpc)) {
+ down_write(&nm_i->nat_tree_lock);
+ remove_nats_in_journal(sbi);
+ up_write(&nm_i->nat_tree_lock);
+ }
+
if (!nm_i->dirty_nat_cnt)
return;