Skip to contentSkip to conversation

f2fs: update max_orphans inode number

PATCH In review Yunlei He 2 participants 2 messages Apr 5, 2017 F2FS file system

lore
Share & tools
lore

Yunlei He

author
#0 lore raw

PATCH 1/1 f2fs: update max_orphans inode number

This patch update max_orphans inode number, remove nat bits blocks

---
 fs/f2fs/checkpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/checkpoint.c +2 -2
index 9aba0bb..64dd429 100644
@@ -1357,8 +1357,8 @@ void init_ino_entry_info(struct f2fs_sb_info *sbi)
 	}
 
 	sbi->max_orphans = (sbi->blocks_per_seg - F2FS_CP_PACKS -
-			NR_CURSEG_TYPE - __cp_payload(sbi)) *
-				F2FS_ORPHANS_PER_BLOCK;
+			NR_CURSEG_TYPE - __cp_payload(sbi) -
+			NM_I(sbi)->nat_bits_blocks) * F2FS_ORPHANS_PER_BLOCK;
 }
 
 int __init create_checkpoint_caches(void)
Signature · 6 lines
2.10.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
#1 lore raw
Quoted 1 line · Yunlei He

This patch update max_orphans inode number, remove nat bits blocks

We will disable nat bits cache and end up persistence of nat bits blocks once there is no enough space in checkpoint region during doing checkpoint. So it's not needed to update max orphan number according to .nat_bits_blocks.

Thanks,

Quoted 12 lines
---
 fs/f2fs/checkpoint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/checkpoint.c +0 -0
index 9aba0bb..64dd429 100644

fs/f2fs/checkpoint.c void init_ino_entry_info(struct f2fs_sb_info *sbi) · line 1364

Quoted 10 lines
fs/f2fs/checkpoint.c +2 -2
@@ -1357,8 +1357,8 @@ void init_ino_entry_info(struct f2fs_sb_info *sbi)
 	}
 
 	sbi->max_orphans = (sbi->blocks_per_seg - F2FS_CP_PACKS -
-			NR_CURSEG_TYPE - __cp_payload(sbi)) *
-				F2FS_ORPHANS_PER_BLOCK;
+			NR_CURSEG_TYPE - __cp_payload(sbi) -
+			NM_I(sbi)->nat_bits_blocks) * F2FS_ORPHANS_PER_BLOCK;
 }
 
 int __init create_checkpoint_caches(void)

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