summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-04-25 06:21:12 +0200
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-04-26 03:35:13 +0200
commit9198aceb53a493d1be0f3a5a1ce13c07a6fdcd26 (patch)
tree21e09f1bffc782fad37b74f0782e8a26d8ced11c /fs/f2fs
parentf2fs: add REQ_META about metadata requests for submit (diff)
downloadlinux-9198aceb53a493d1be0f3a5a1ce13c07a6fdcd26.tar.xz
linux-9198aceb53a493d1be0f3a5a1ce13c07a6fdcd26.zip
f2fs: check nid == 0 in add_free_nid
It is more obvious that add_free_nid checks whether the free nid is zero or not. Reviewed-by: Namjae Jeon <namjae.jeon@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, 4 insertions, 4 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a0aa0446a237..c8f48d436487 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1245,6 +1245,10 @@ static int add_free_nid(struct f2fs_nm_info *nm_i, nid_t nid)
if (nm_i->fcnt > 2 * MAX_FREE_NIDS)
return 0;
+
+ /* 0 nid should not be used */
+ if (nid == 0)
+ return 0;
retry:
i = kmem_cache_alloc(free_nid_slab, GFP_NOFS);
if (!i) {
@@ -1286,10 +1290,6 @@ static int scan_nat_page(struct f2fs_nm_info *nm_i,
int fcnt = 0;
int i;
- /* 0 nid should not be used */
- if (start_nid == 0)
- ++start_nid;
-
i = start_nid % NAT_ENTRY_PER_BLOCK;
for (; i < NAT_ENTRY_PER_BLOCK; i++, start_nid++) {