summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2014-03-07 18:43:24 +0800
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-03-10 18:45:09 +0900
commitb6ce391e615175029cb8496f03afc9905e0957cc (patch)
treebcc0d5ad69a1bd264c561c22402c352967502bf4 /fs/f2fs
parent20f70751c6b4ac5055be9a0d8a3d3189a81afc5a (diff)
downloadlinux-stable-b6ce391e615175029cb8496f03afc9905e0957cc.tar.gz
linux-stable-b6ce391e615175029cb8496f03afc9905e0957cc.tar.bz2
linux-stable-b6ce391e615175029cb8496f03afc9905e0957cc.zip
f2fs: update start nid only once each circle
Integrated a couple of minor changes for better readability suggested by Chao Yu. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/node.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 8c1411060e7e..77b61893fc8d 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1875,11 +1875,9 @@ void destroy_node_manager(struct f2fs_sb_info *sbi)
while ((found = __gang_lookup_nat_cache(nm_i,
nid, NATVEC_SIZE, natvec))) {
unsigned idx;
- for (idx = 0; idx < found; idx++) {
- struct nat_entry *e = natvec[idx];
- nid = nat_get_nid(e) + 1;
- __del_from_nat_cache(nm_i, e);
- }
+ nid = nat_get_nid(natvec[found - 1]) + 1;
+ for (idx = 0; idx < found; idx++)
+ __del_from_nat_cache(nm_i, natvec[idx]);
}
f2fs_bug_on(nm_i->nat_cnt);
write_unlock(&nm_i->nat_tree_lock);