diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-01-22 11:19:05 +0800 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2015-03-23 10:10:26 -0700 |
commit | 3f4bcefe561da90a2639436dc66a8e6e783ea040 (patch) | |
tree | c8175239f81288c27b1cf327c1240d0da6aa9a5f | |
parent | 550702090691af07a3282119ef4f37440c93829e (diff) | |
download | f2fs-tools-3f4bcefe561da90a2639436dc66a8e6e783ea040.tar.gz |
fibmap.f2fs: fix the wrong stat info
fibmap shows ino, size, blocks with incorrectly decimal number, fix it.
Before:
--------------------------------------------
dev [8:16]
ino [0x 238ea : 0]
mode [0x 81a4 : 33188]
nlink [0x 1 : 1]
uid [0x 0 : 0]
gid [0x 0 : 0]
size [0x 79e00 : 0]
blksize [0x 1000 : 4096]
blocks [0x 268 : 0]
--------------------------------------------
Patched:
--------------------------------------------
dev [8:16]
ino [0x 238ea : 145642]
mode [0x 81a4 : 33188]
nlink [0x 1 : 1]
uid [0x 0 : 0]
gid [0x 0 : 0]
size [0x 79e00 : 499200]
blksize [0x 1000 : 4096]
blocks [0x 268 : 616]
--------------------------------------------
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | tools/fibmap.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/fibmap.c b/tools/fibmap.c index a6a112b..224b233 100644 --- a/tools/fibmap.c +++ b/tools/fibmap.c @@ -12,6 +12,7 @@ #include <linux/hdreg.h> #include <linux/types.h> #include <linux/fs.h> +#include <inttypes.h> struct file_ext { __u32 f_pos; @@ -33,14 +34,17 @@ void print_stat(struct stat64 *st) { printf("--------------------------------------------\n"); printf("dev [%d:%d]\n", major(st->st_dev), minor(st->st_dev)); - printf("ino [0x%8lx : %ld]\n", st->st_ino, st->st_ino); + printf("ino [0x%8"PRIx64" : %"PRIu64"]\n", + st->st_ino, st->st_ino); printf("mode [0x%8x : %d]\n", st->st_mode, st->st_mode); printf("nlink [0x%8lx : %ld]\n", st->st_nlink, st->st_nlink); printf("uid [0x%8x : %d]\n", st->st_uid, st->st_uid); printf("gid [0x%8x : %d]\n", st->st_gid, st->st_gid); - printf("size [0x%8lx : %ld]\n", st->st_size, st->st_size); + printf("size [0x%8"PRIx64" : %"PRIu64"]\n", + st->st_size, st->st_size); printf("blksize [0x%8lx : %ld]\n", st->st_blksize, st->st_blksize); - printf("blocks [0x%8lx : %ld]\n", st->st_blocks, st->st_blocks); + printf("blocks [0x%8"PRIx64" : %"PRIu64"]\n", + st->st_blocks, st->st_blocks); printf("--------------------------------------------\n\n"); } |