f2fs: save a multiplication for last_nid calculation
authorFan Li <fanofcode.li@samsung.com>
Thu, 2 Nov 2017 03:02:52 +0000 (11:02 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 19 Dec 2017 03:38:28 +0000 (19:38 -0800)
Use a slightly easier way to calculate last_nid.

Signed-off-by: Fan li <fanofcode.li@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index a7f6603bfbea013c7c377aa9373236478e062f4c..fef5c68886b1c0512fd130a516866173b892f07b 100644 (file)
@@ -2626,7 +2626,7 @@ static inline void load_free_nid_bitmap(struct f2fs_sb_info *sbi)
                __set_bit_le(i, nm_i->nat_block_bitmap);
 
                nid = i * NAT_ENTRY_PER_BLOCK;
-               last_nid = (i + 1) * NAT_ENTRY_PER_BLOCK;
+               last_nid = nid + NAT_ENTRY_PER_BLOCK;
 
                spin_lock(&NM_I(sbi)->nid_list_lock);
                for (; nid < last_nid; nid++)