Skip to contentSkip to conversation

libf2fs: print block size

PATCH New Chao Yu via Linux-f2fs-devel 1 participant 1 message May 12, 2025 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libf2fs: print block size

nl6720 reported in [1], mkfs.f2fs doesn't report block size, instead, it prints sector size which is not used inside f2fs. Let's print block size as well during mkfs as below:

output of mkfs.f2fs:

Info: sector size = 512
Info: total sectors = 16777216 (8192 MB)
Info: block size = 4096

[1] https://lore.kernel.org/linux-f2fs-devel/[email protected]

---
 lib/libf2fs.c | 1 +
 1 file changed, 1 insertion(+)
lib/libf2fs.c +1 -0
index d2579d7..40c974d 100644
@@ -1375,6 +1375,7 @@ int f2fs_get_f2fs_info(void)
 	MSG(0, "Info: total sectors = %"PRIu64" (%"PRIu64" MB)\n",
 				c.total_sectors, (c.total_sectors *
 					(c.sector_size >> 9)) >> 11);
+	MSG(0, "Info: block size = %u\n", c.blksize);
 	return 0;
 }
 
Signature · 8 lines
2.49.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel