btrfs-progs: Add nbytes output for print-tree and reformat inode output
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 19 Jun 2015 03:49:19 +0000 (11:49 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 26 Jun 2015 14:47:57 +0000 (16:47 +0200)
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 <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
print-tree.c

index df63334..a72a979 100644 (file)
@@ -841,10 +841,13 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
                switch (type) {
                case BTRFS_INODE_ITEM_KEY:
                        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),