diff mbox series

[f2fs-dev] f2fs-tools: show device info of sb->devs

Message ID 20240712020133.140148-2-shengyong@oppo.com (mailing list archive)
State New
Headers show
Series [f2fs-dev] f2fs-tools: show device info of sb->devs | expand

Commit Message

Sheng Yong July 12, 2024, 2:01 a.m. UTC
Show multidevice infomation like the follwoing:

  devs[i].path                            [meta.img]
  devs[i].total_segments                  [0x      3f : 63]
  devs[i].path                            [data.img]
  devs[i].total_segments                  [0x      80 : 128]

Signed-off-by: Sheng Yong <shengyong@oppo.com>
---
 fsck/mount.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Chao Yu July 12, 2024, 7:13 a.m. UTC | #1
On 2024/7/12 10:01, Sheng Yong wrote:
> Show multidevice infomation like the follwoing:
> 
>    devs[i].path                            [meta.img]
>    devs[i].total_segments                  [0x      3f : 63]
>    devs[i].path                            [data.img]
>    devs[i].total_segments                  [0x      80 : 128]
> 
> Signed-off-by: Sheng Yong <shengyong@oppo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/fsck/mount.c b/fsck/mount.c
index 8524335da4da..ad1a49a84109 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -469,6 +469,7 @@  void print_raw_sb_info(struct f2fs_super_block *sb)
 	char uuid[40];
 	char encrypt_pw_salt[40];
 #endif
+	int i;
 
 	if (c.layout)
 		goto printout;
@@ -537,6 +538,13 @@  printout:
 	DISP_raw_str("%-.36s", encrypt_pw_salt);
 #endif
 
+	for (i = 0; i < MAX_DEVICES; i++) {
+		if (!sb->devs[i].path[0])
+			break;
+		DISP_str("%s", sb, devs[i].path);
+		DISP_u32(sb, devs[i].total_segments);
+	}
+
 	DISP_u32(sb, qf_ino[USRQUOTA]);
 	DISP_u32(sb, qf_ino[GRPQUOTA]);
 	DISP_u32(sb, qf_ino[PRJQUOTA]);