path: root/print-tree.c
diff options
authorQu Wenruo <>2015-06-19 11:49:19 +0800
committerDavid Sterba <>2015-06-26 16:47:57 +0200
commitdf0bb2f1d20490d8625ff1b6bafe9bc5c556b4a6 (patch)
treef03690d5a2bebd516f809f0188f0e22f364d6301 /print-tree.c
parente7d0a023aed0ed4f0d435a10b5e92f9d7fbd4dd7 (diff)
btrfs-progs: Add nbytes output for print-tree and reformat inode output
The original implementation doesn't output the nbytes for an inode. Add the output and since the output is too long, reformat it to multi lines. This is very handy to debug related bugs. Signed-off-by: Qu Wenruo <> Signed-off-by: David Sterba <>
Diffstat (limited to 'print-tree.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/print-tree.c b/print-tree.c
index df63334f..a72a979f 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -841,10 +841,13 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
switch (type) {
ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
- printf("\t\tinode generation %llu transid %llu size %llu block group %llu mode %o links %u uid %u gid %u rdev %llu flags 0x%llx\n",
+ printf("\t\tinode generation %llu transid %llu size %llu nbytes %llu\n"
+ "\t\tblock group %llu mode %o links %u uid %u gid %u\n"
+ "\t\trdev %llu flags 0x%llx\n",
(unsigned long long)btrfs_inode_generation(l, ii),
(unsigned long long)btrfs_inode_transid(l, ii),
(unsigned long long)btrfs_inode_size(l, ii),
+ (unsigned long long)btrfs_inode_nbytes(l, ii),
(unsigned long long)btrfs_inode_block_group(l,ii),
btrfs_inode_mode(l, ii),
btrfs_inode_nlink(l, ii),