linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] erofs-utils: dump: print filesystem blocksize
@ 2024-04-18  0:00 Sandeep Dhavale via Linux-erofs
  2024-04-18  4:49 ` Gao Xiang
  0 siblings, 1 reply; 2+ messages in thread
From: Sandeep Dhavale via Linux-erofs @ 2024-04-18  0:00 UTC (permalink / raw)
  To: linux-erofs; +Cc: hsiangkao, kernel-team

mkfs.erofs supports creating filesystem images with different
blocksizes. Add filesystem blocksize in super block dump so
its easier to inspect the filesystem.

The field is added after FS magic, so the output now looks like:

Filesystem magic number:                      0xE0F5E1E2
Filesystem blocksize:                         65536
Filesystem blocks:                            21
Filesystem inode metadata start block:        0
Filesystem shared xattr metadata start block: 0
Filesystem root nid:                          36
Filesystem lz4_max_distance:                  65535
Filesystem sb_extslots:                       0
Filesystem inode count:                       10
Filesystem created:                           Wed Apr 17 16:53:10 2024
Filesystem features:                          sb_csum mtime 0padding
Filesystem UUID:                              e66f6dd1-6882-48c3-9770-fee7c4841a93

Signed-off-by: Sandeep Dhavale <dhavale@google.com>
---
Changes since v2:
	- Use %u to print the FS blocksize as we don't expect it to be
	  very large as suggested by Gao
Changes since v1:
	- Moved the field after FS magic as suggested by Gao
 dump/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dump/main.c b/dump/main.c
index a89fc6b..dd2c620 100644
--- a/dump/main.c
+++ b/dump/main.c
@@ -633,6 +633,8 @@ static void erofsdump_show_superblock(void)
 
 	fprintf(stdout, "Filesystem magic number:                      0x%04X\n",
 			EROFS_SUPER_MAGIC_V1);
+	fprintf(stdout, "Filesystem blocksize:                         %u\n",
+			erofs_blksiz(&sbi));
 	fprintf(stdout, "Filesystem blocks:                            %llu\n",
 			sbi.total_blocks | 0ULL);
 	fprintf(stdout, "Filesystem inode metadata start block:        %u\n",
-- 
2.44.0.683.g7961c838ac-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] erofs-utils: dump: print filesystem blocksize
  2024-04-18  0:00 [PATCH v3] erofs-utils: dump: print filesystem blocksize Sandeep Dhavale via Linux-erofs
@ 2024-04-18  4:49 ` Gao Xiang
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2024-04-18  4:49 UTC (permalink / raw)
  To: Sandeep Dhavale; +Cc: hsiangkao, kernel-team, linux-erofs

On Wed, Apr 17, 2024 at 05:00:54PM -0700, Sandeep Dhavale wrote:
> mkfs.erofs supports creating filesystem images with different
> blocksizes. Add filesystem blocksize in super block dump so
> its easier to inspect the filesystem.
> 
> The field is added after FS magic, so the output now looks like:
> 
> Filesystem magic number:                      0xE0F5E1E2
> Filesystem blocksize:                         65536
> Filesystem blocks:                            21
> Filesystem inode metadata start block:        0
> Filesystem shared xattr metadata start block: 0
> Filesystem root nid:                          36
> Filesystem lz4_max_distance:                  65535
> Filesystem sb_extslots:                       0
> Filesystem inode count:                       10
> Filesystem created:                           Wed Apr 17 16:53:10 2024
> Filesystem features:                          sb_csum mtime 0padding
> Filesystem UUID:                              e66f6dd1-6882-48c3-9770-fee7c4841a93
> 
> Signed-off-by: Sandeep Dhavale <dhavale@google.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-18  4:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  0:00 [PATCH v3] erofs-utils: dump: print filesystem blocksize Sandeep Dhavale via Linux-erofs
2024-04-18  4:49 ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).