summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-02-28 14:34:47 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2017-03-22 03:34:20 +0100
commit0b28b71e298fb7b74ee8a74e2f9d4d45c44f5483 (patch)
treebfe0b90d5900a4983df4afa83594bdd0c7657fd7 /fs/f2fs/node.c
parentf2fs: make sure trace all f2fs_issue_flush (diff)
downloadlinux-0b28b71e298fb7b74ee8a74e2f9d4d45c44f5483.tar.xz
linux-0b28b71e298fb7b74ee8a74e2f9d4d45c44f5483.zip
f2fs: drop duplicate radix tree lookup of nat_entry_set
The nat entry is listed from the set list for freeing, it's duplicate to do radix tree lookup again. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> [Jaegeuk Kim: remove unnecessary f2fs_bug_on] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 481aa8dc79f4..11df8ab32478 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -177,18 +177,12 @@ static void __set_nat_cache_dirty(struct f2fs_nm_info *nm_i,
}
static void __clear_nat_cache_dirty(struct f2fs_nm_info *nm_i,
- struct nat_entry *ne)
+ struct nat_entry_set *set, struct nat_entry *ne)
{
- nid_t set = NAT_BLOCK_OFFSET(ne->ni.nid);
- struct nat_entry_set *head;
-
- head = radix_tree_lookup(&nm_i->nat_set_root, set);
- if (head) {
- list_move_tail(&ne->list, &nm_i->nat_entries);
- set_nat_flag(ne, IS_DIRTY, false);
- head->entry_cnt--;
- nm_i->dirty_nat_cnt--;
- }
+ list_move_tail(&ne->list, &nm_i->nat_entries);
+ set_nat_flag(ne, IS_DIRTY, false);
+ set->entry_cnt--;
+ nm_i->dirty_nat_cnt--;
}
static unsigned int __gang_lookup_nat_set(struct f2fs_nm_info *nm_i,
@@ -2407,7 +2401,7 @@ static void __flush_nat_entry_set(struct f2fs_sb_info *sbi,
}
raw_nat_from_node_info(raw_ne, &ne->ni);
nat_reset_flag(ne);
- __clear_nat_cache_dirty(NM_I(sbi), ne);
+ __clear_nat_cache_dirty(NM_I(sbi), set, ne);
if (nat_get_blkaddr(ne) == NULL_ADDR) {
add_free_nid(sbi, nid, false);
spin_lock(&NM_I(sbi)->nid_list_lock);