On 2018年03月20日 16:45, Nikolay Borisov wrote:
> Currently we print the raw values of the owner field of leaf/nodes.
> This can result in output like the following:
> 
> leaf 30490624 items 2 free space 16061 generation 4 owner 18446744073709551607
> 
> With the patch applied the same leaf looks like:
> 
> leaf 30490624 items 2 free space 16061 generation 4 owner DATA_RELOC_TREE
> 
> Signed-off-by: Nikolay Borisov <nbori...@suse.com>

Looks good.

Reviewed-by: Qu Wenruo <w...@suse.com>

Thanks,
Qu

> ---
>  print-tree.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/print-tree.c b/print-tree.c
> index d59f9002f54c..a2f6bfc027c9 100644
> --- a/print-tree.c
> +++ b/print-tree.c
> @@ -1188,11 +1188,12 @@ void btrfs_print_leaf(struct btrfs_root *root, struct 
> extent_buffer *eb)
>       header_flags_to_str(flags, flags_str);
>       nr = btrfs_header_nritems(eb);
>  
> -     printf("leaf %llu items %d free space %d generation %llu owner %llu\n",
> +     printf("leaf %llu items %d free space %d generation %llu owner ",
>               (unsigned long long)btrfs_header_bytenr(eb), nr,
>               btrfs_leaf_free_space(root, eb),
> -             (unsigned long long)btrfs_header_generation(eb),
> -             (unsigned long long)btrfs_header_owner(eb));
> +             (unsigned long long)btrfs_header_generation(eb));
> +     print_objectid(stdout, btrfs_header_owner(eb), 0);
> +     printf("\n");
>       printf("leaf %llu flags 0x%llx(%s) backref revision %d\n",
>               btrfs_header_bytenr(eb), flags, flags_str, backref_rev);
>       print_uuids(eb);
> @@ -1365,12 +1366,13 @@ void btrfs_print_tree(struct btrfs_root *root, struct 
> extent_buffer *eb, int fol
>               btrfs_print_leaf(root, eb);
>               return;
>       }
> -     printf("node %llu level %d items %d free %u generation %llu owner 
> %llu\n",
> +     printf("node %llu level %d items %d free %u generation %llu owner ",
>              (unsigned long long)eb->start,
>               btrfs_header_level(eb), nr,
>               (u32)BTRFS_NODEPTRS_PER_BLOCK(root->fs_info) - nr,
> -             (unsigned long long)btrfs_header_generation(eb),
> -             (unsigned long long)btrfs_header_owner(eb));
> +             (unsigned long long)btrfs_header_generation(eb));
> +     print_objectid(stdout, btrfs_header_owner(eb), 0);
> +     printf("\n");
>       print_uuids(eb);
>       fflush(stdout);
>       for (i = 0; i < nr; i++) {
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to