Skip to content

Commit c1b9a47

Browse files
fdmananakdave
authored andcommitted
btrfs: print-tree: print correct inline extent data size
We are advertising the ram_bytes of an inline extent as its data size, but that is not true for compressed extents. The ram_bytes corresponds to the uncompressed data size while the data size (compressed data) is given by btrfs_file_extent_inline_item_len(). So fix this and print both values in the same format as in btrfs-progs. Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 4dc1c3d commit c1b9a47

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

fs/btrfs/print-tree.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "messages.h"
77
#include "ctree.h"
88
#include "disk-io.h"
9+
#include "file-item.h"
910
#include "print-tree.h"
1011
#include "accessors.h"
1112
#include "tree-checker.h"
@@ -423,8 +424,9 @@ void btrfs_print_leaf(const struct extent_buffer *l)
423424
btrfs_file_extent_type(l, fi));
424425
if (btrfs_file_extent_type(l, fi) ==
425426
BTRFS_FILE_EXTENT_INLINE) {
426-
pr_info("\t\tinline extent data size %llu\n",
427-
btrfs_file_extent_ram_bytes(l, fi));
427+
pr_info("\t\tinline extent data size %u ram_bytes %llu\n",
428+
btrfs_file_extent_inline_item_len(l, i),
429+
btrfs_file_extent_ram_bytes(l, fi));
428430
break;
429431
}
430432
pr_info("\t\textent data disk bytenr %llu nr %llu\n",

0 commit comments

Comments
 (0)