Commit b6ce391e615175029cb8496f03afc9905e0957cc
Committed by
Jaegeuk Kim
1 parent
20f70751c6
Exists in
master
and in
13 other branches
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>
Showing 1 changed file with 3 additions and 5 deletions Side-by-side Diff
fs/f2fs/node.c
... | ... | @@ -1875,11 +1875,9 @@ |
1875 | 1875 | while ((found = __gang_lookup_nat_cache(nm_i, |
1876 | 1876 | nid, NATVEC_SIZE, natvec))) { |
1877 | 1877 | unsigned idx; |
1878 | - for (idx = 0; idx < found; idx++) { | |
1879 | - struct nat_entry *e = natvec[idx]; | |
1880 | - nid = nat_get_nid(e) + 1; | |
1881 | - __del_from_nat_cache(nm_i, e); | |
1882 | - } | |
1878 | + nid = nat_get_nid(natvec[found - 1]) + 1; | |
1879 | + for (idx = 0; idx < found; idx++) | |
1880 | + __del_from_nat_cache(nm_i, natvec[idx]); | |
1883 | 1881 | } |
1884 | 1882 | f2fs_bug_on(nm_i->nat_cnt); |
1885 | 1883 | write_unlock(&nm_i->nat_tree_lock); |