diff options
author | Daeho Jeong <daehojeong@google.com> | 2021-07-21 14:12:40 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2021-07-22 13:52:15 -0700 |
commit | 529967eac0a1f064b889234a3ef62270f143c770 (patch) | |
tree | b1dc83f55214d35ca92b1fab0d1575e30e3f0945 | |
parent | 1228009520d1d2cb392ae52f8aaf3c6ec42edccf (diff) | |
download | f2fs-tools-529967eac0a1f064b889234a3ef62270f143c770.tar.gz |
f2fs-tools: make fiemap command in accordance with uapi
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>
-rw-r--r-- | tools/f2fs_io/f2fs_io.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index aa1a7e4..42dbd60 100644 --- a/tools/f2fs_io/f2fs_io.c +++ b/tools/f2fs_io/f2fs_io.c @@ -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"); |