All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: Beautify owner when printing leaf/nodes
@ 2018-03-20  8:45 Nikolay Borisov
  2018-03-20 12:52 ` Qu Wenruo
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Borisov @ 2018-03-20  8:45 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

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 <nborisov@suse.com>
---
 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++) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs-progs: Beautify owner when printing leaf/nodes
  2018-03-20  8:45 [PATCH] btrfs-progs: Beautify owner when printing leaf/nodes Nikolay Borisov
@ 2018-03-20 12:52 ` Qu Wenruo
  2018-03-21 17:08   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Qu Wenruo @ 2018-03-20 12:52 UTC (permalink / raw)
  To: Nikolay Borisov, linux-btrfs


[-- Attachment #1.1: Type: text/plain, Size: 2350 bytes --]



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 <nborisov@suse.com>

Looks good.

Reviewed-by: Qu Wenruo <wqu@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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 520 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs-progs: Beautify owner when printing leaf/nodes
  2018-03-20 12:52 ` Qu Wenruo
@ 2018-03-21 17:08   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2018-03-21 17:08 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Nikolay Borisov, linux-btrfs

On Tue, Mar 20, 2018 at 08:52:22PM +0800, Qu Wenruo wrote:
> 
> 
> 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 <nborisov@suse.com>
> 
> Looks good.
> 
> Reviewed-by: Qu Wenruo <wqu@suse.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-21 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20  8:45 [PATCH] btrfs-progs: Beautify owner when printing leaf/nodes Nikolay Borisov
2018-03-20 12:52 ` Qu Wenruo
2018-03-21 17:08   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.