Re: [PATCH v9 03/11] f2fs: describe NAT block layout dynamically
From: Chao Yu
Date: Thu Sep 03 2026 - 21:58:12 EST
On 9/4/26 07:56, Kelvin Zhang wrote:
A NAT block is a filesystem-block-sized array of struct f2fs_nat_entry
elements. The compile-time NAT_ENTRY_PER_BLOCK definition hardcodes the
NAT capacity to a 4KB block size.
Replace the fixed array in struct f2fs_nat_block with a C flexible
array member, and calculate sbi->nat_entries_per_block dynamically in
init_sb_info().
Parameterize NAT geometry helpers (NAT_ENTRY_PER_BLOCK,
NAT_BLOCK_OFFSET, f2fs_start_nid, NAT_BLK_CNT, and
f2fs_nat_bitmap_size) with sbi. Update call sites across node management,
checkpointing, GC, and sysfs.
This is a layout-only change without behavioral differences for 4KB
blocks.
Signed-off-by: Kelvin Zhang <zhangxp1998@xxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
Thanks,