Skip to contentSkip to conversation

f2fs: save a multiplication for last_nid calculation

PATCH In review Fan Li 2 participants 2 messages Nov 2, 2017 1 message not in the archive F2FS file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20171102030338epcas1p19ad41be52b4346e4828fd9e0cc92d711@epcas1p1.samsung.com

Fan Li

author
#1 lore raw

PATCH 1/1 f2fs: save a multiplication for last_nid calculation

Use a slightly easier way to calculate last_nid.

---
 fs/f2fs/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.c +1 -1
index 7834097..55ab330 100644
@@ -2642,7 +2642,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++)

--
2.7.4

maintainer Reviewed-by on v1 1/1
#2 lore raw
Quoted 3 lines · Fan Li

Use a slightly easier way to calculate last_nid.

Thanks,

Quoted 18 lines
---
 fs/f2fs/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.c +1 -2
index 7834097..55ab330 100644
@@ -2642,7 +2642,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++)
--
Quoted 2 lines

2.7.4

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot