summaryrefslogtreecommitdiff
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2018-06-29 05:34:40 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2018-07-12 05:54:51 +0300
commit7f2ecdd837ae0a27149a0387b2534e11d955c5f8 (patch)
tree726673a06e25d7c029612370eeb4d5799776672c /fs/f2fs/node.c
parentb4d0562137c9035becad5fc0588f6163aed916db (diff)
downloadlinux-7f2ecdd837ae0a27149a0387b2534e11d955c5f8.tar.xz
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;