f2fs-tools: make fiemap command in accordance with uapi

commit 529967eac0
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

Made "fiemap" command in accordance with user api manual. So, eliminated
NEW_ADDR print out and made it ends in the last extent.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
Daeho Jeong 2021-07-21 14:12:40 -07:00 committed by dongsenhao
parent cdca0b4dff
commit 025371e721

View File

@ -757,10 +757,11 @@ static void do_fiemap(int argc, char **argv, const struct cmd_desc *cmd)
die_errno("FIEMAP failed");
phy_addr = fm->fm_extents[0].fe_physical / F2FS_BLKSIZE;
if (phy_addr == NEW_ADDR)
printf("NEW_ADDR ");
else
printf("%llu ", phy_addr);
printf("%llu: %llu\n", fm->fm_start / F2FS_BLKSIZE, phy_addr);
if (fm->fm_extents[0].fe_flags & FIEMAP_EXTENT_LAST)
break;
fm->fm_start += F2FS_BLKSIZE;
}
printf("\n");