f2fs-tools: fix printing block adresses
PATCH 1/1 f2fs-tools: fix printing block adresses
This patch allows properly printing all addresses in an inode. It is useful in commands like dump.f2fs.
--- fsck/mount.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fsck/mount.c +6 -4
@@ -92,12 +92,14 @@ void print_inode_info(struct f2fs_inode *inode, int name)DISP_u32 (inode, i_addr[2 ]);/* Pointers to data blocks */ DISP_u32 (inode, i_addr[3 ]);/* Pointers to data blocks */ -for (i =4 ; i <ADDRS_PER_INODE (inode); i++) { +for (i =0 ; i <ADDRS_PER_INODE (inode); i++) {if (inode->i_addr[i] !=0x0 ) { -printf ("i_addr[0x%x] points data block\r\t\t[0x%4x]\n" , - i,le32_to_cpu (inode->i_addr[i])); -break ; +if (i>3 ) +printf ("i_addr[0x%x] points data block\t\t[0x%4x]\n" , + i,le32_to_cpu (inode->i_addr[i])); } +else +break ; }DISP_u32 (inode, i_nid[0 ]);/* direct */
Signature · 6 lines
2.1.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Hi Piotr,
I've modified your patch to resolve some conflicts and add your SoB. Could you take a look at this?
Thanks,
Quoted 41 lines · Piotr Sokołowski
This patch allows properly printing all addresses in an inode. It is useful in commands like dump.f2fs.
--- fsck/mount.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)fsck/mount.c +6
-4@@ -92,12 +92,14 @@ void print_inode_info(struct f2fs_inode *inode, int name)DISP_u32 (inode, i_addr[2 ]);/* Pointers to data blocks */ DISP_u32 (inode, i_addr[3 ]);/* Pointers to data blocks */ -for (i =4 ; i <ADDRS_PER_INODE (inode); i++) { +for (i =0 ; i <ADDRS_PER_INODE (inode); i++) {if (inode->i_addr[i] !=0x0 ) { -printf ("i_addr[0x%x] points data block\r\t\t[0x%4x]\n" , - i,le32_to_cpu (inode->i_addr[i])); -break ; +if (i>3 ) +printf ("i_addr[0x%x] points data block\t\t[0x%4x]\n" , + i,le32_to_cpu (inode->i_addr[i])); } +else +break ; }DISP_u32 (inode, i_nid[0 ]);/* direct */ Signature · 10 lines
2.1.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 25 lines · Jaegeuk Kim
Hi Piotr,
I've modified your patch to resolve some conflicts and add your SoB. Could you take a look at this?
Thanks,
Quoted 15 lines · Piotr Sokołowski
This patch allows properly printing all addresses in an inode. It is useful in commands like dump.f2fs.
--- fsck/mount.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)fsck/mount.c +0
-0@@ -92,12 +92,14 @@ void print_inode_info(struct f2fs_inode *inode, int name)DISP_u32 (inode, i_addr[2 ]);/* Pointers to data blocks */ DISP_u32 (inode, i_addr[3 ]);/* Pointers to data blocks */
Quoted 12 lines
fsck/mount.c void print_inode_info(struct f2fs_inode *inode, int name) · line 102
Quoted 12 lines
fsck/mount.c +6
-4-for (i =4 ; i <ADDRS_PER_INODE (inode); i++) { +for (i =0 ; i <ADDRS_PER_INODE (inode); i++) {if (inode->i_addr[i] !=0x0 ) { -printf ("i_addr[0x%x] points data block\r\t\t[0x%4x]\n" , - i,le32_to_cpu (inode->i_addr[i])); -break ; +if (i>3 ) +printf ("i_addr[0x%x] points data block\t\t[0x%4x]\n" , + i,le32_to_cpu (inode->i_addr[i])); } +else +break ;
What about just skipping if i_addr is 0x00? then bellow valid blkaddrs could be printed.
Thanks,
Quoted 15 lines
Quoted 14 lines
fsck/mount.c +0
-0}DISP_u32 (inode, i_nid[0 ]);/* direct */ Signature · 10 lines
2.1.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 8 lines
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel