diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-06-29 04:34:40 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-07-12 04:54:51 +0200 |
commit | 7f2ecdd837ae0a27149a0387b2534e11d955c5f8 (patch) | |
tree | 726673a06e25d7c029612370eeb4d5799776672c /fs | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s39... (diff) | |
download | linux-7f2ecdd837ae0a27149a0387b2534e11d955c5f8.tar.xz linux-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')
-rw-r--r-- | fs/f2fs/node.c | 7 |
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; |