Skip to contentSkip to conversation

erofs-utils: dump: print filesystem blocksize

PATCH Superseded Sandeep Dhavale via Linux-erofs 2 participants 4 messages Apr 12, 2024 – Apr 13, 2024

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 erofs-utils: dump: print filesystem blocksize

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

The filed is added at last, so the output now looks like:

Filesystem magic number:                      0xE0F5E1E2
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:                           Fri Apr 12 15:43:40 2024
Filesystem features:                          sb_csum mtime 0padding
Filesystem UUID:                              a84a2acc-08d8-4b72-8b8c-b811a815fa07
Filesystem blocksize:                         65536
---
 dump/main.c | 2 ++
 1 file changed, 2 insertions(+)
dump/main.c +2 -0
index a89fc6b..947a5a4 100644
@@ -669,6 +669,8 @@ static void erofsdump_show_superblock(void)
 	erofs_uuid_unparse_lower(sbi.uuid, uuid_str);
 	fprintf(stdout, "\nFilesystem UUID:                              %s\n",
 			uuid_str);
+	fprintf(stdout, "Filesystem blocksize:                         %llu\n",
+			erofs_blksiz(&sbi) | 0ULL);
 }
 
 int main(int argc, char **argv)
Signature · 1 line
2.44.0.683.g7961c838ac-goog
#1 lore raw

Hi Sandeep,

Quoted 19 lines · Sandeep Dhavale

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

The filed is added at last, so the output now looks like:

Filesystem magic number:                      0xE0F5E1E2
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:                           Fri Apr 12 15:43:40 2024
Filesystem features:                          sb_csum mtime 0padding
Filesystem UUID:                              a84a2acc-08d8-4b72-8b8c-b811a815fa07
Filesystem blocksize:                         65536
Quoted 1 line

Just a minor nit:
Could we move "Filesystem blocksize:" between the line of "Filesystem magic number:" and "Filesystem blocks:" ?

Otherwise it looks good to me, thanks for this!

Thanks,
Gao Xiang

#2 lore raw
Quoted 23 lines · Gao Xiang

Hi Sandeep,

Quoted 19 lines · Sandeep Dhavale

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

The filed is added at last, so the output now looks like:

Filesystem magic number:                      0xE0F5E1E2
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:                           Fri Apr 12 15:43:40 2024
Filesystem features:                          sb_csum mtime 0padding
Filesystem UUID:                              a84a2acc-08d8-4b72-8b8c-b811a815fa07
Filesystem blocksize:                         65536
Quoted 8 lines
Quoted 1 line

Just a minor nit:
Could we move "Filesystem blocksize:" between the line of "Filesystem magic number:" and "Filesystem blocks:" ?

Otherwise it looks good to me, thanks for this!

Hi Gao,
Sure I can change the location. I didn't do it assuming someone might have scripted around it (not that I know of!), so I added it last. I will send V2 by moving it after magic number.

Thanks,
Sandeep.

Quoted 2 lines

Thanks,
Gao Xiang

#3 lore raw
Quoted 30 lines · Sandeep Dhavale
Quoted 29 lines · Gao Xiang

Hi Sandeep,

Quoted 19 lines · Sandeep Dhavale

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

The filed is added at last, so the output now looks like:

Filesystem magic number:                      0xE0F5E1E2
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:                           Fri Apr 12 15:43:40 2024
Filesystem features:                          sb_csum mtime 0padding
Filesystem UUID:                              a84a2acc-08d8-4b72-8b8c-b811a815fa07
Filesystem blocksize:                         65536
Quoted 1 line

Just a minor nit:
Could we move "Filesystem blocksize:" between the line of "Filesystem magic number:" and "Filesystem blocks:" ?

Quoted 5 lines
Quoted 2 lines

Otherwise it looks good to me, thanks for this!

Hi Gao,
Sure I can change the location. I didn't do it assuming someone might have scripted around it (not that I know of!), so I added it last.

Yeah, I could guess your original intentation. But it seems somewhat strange to show Filesystem blocksize in the very end...

Thanks,
Gao Xiang

Quoted 6 lines

I will send V2 by moving it after magic number.

Thanks,
Sandeep.

Quoted 2 lines

Thanks,
Gao Xiang