From: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
To: Nikolay Borisov <nborisov@suse.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] btrfs-progs: ins: dump-tree: Print tree name for tree block backref
Date: Wed, 30 May 2018 15:55:52 +0900 [thread overview]
Message-ID: <d56cfca8-c6f9-971c-315f-cdde23a71baf@jp.fujitsu.com> (raw)
In-Reply-To: <ee3f5cfe-0b7c-d38e-e602-d5671d80713f@suse.com>
On 2018/05/30 15:28, Nikolay Borisov wrote:
>
>
> On 30.05.2018 07:55, Misono Tomohiro wrote:
>> Print tree name instead of number to make output more readable.
>>
>> Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
>> ---
>> print-tree.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/print-tree.c b/print-tree.c
>> index 90173c2b..8d551d09 100644
>> --- a/print-tree.c
>> +++ b/print-tree.c
>> @@ -470,8 +470,9 @@ void print_extent_item(struct extent_buffer *eb, int slot, int metadata)
>> offset = btrfs_extent_inline_ref_offset(eb, iref);
>> switch (type) {
>> case BTRFS_TREE_BLOCK_REF_KEY:
>> - printf("\t\ttree block backref root %llu\n",
>> - (unsigned long long)offset);
>> + printf("\t\ttree block backref root ");
>> + print_objectid(stdout, offset, 0);
>> + printf("\n");
>
> So this is a good change, yet one thing I'd like to know is if I'm
> inspecting the extent tree with say "btrfs inspect-internal dump-tree -t
> 2" and I see a record :
>
> item 14 key (14540800 EXTENT_ITEM 4096) itemoff 15488 itemsize 53
> refs 1 gen 12 flags DATA
> extent data backref root 5 objectid 479 offset 0 count 1
>
> it will in fact be "root FS_TREE" or some such.
I overlooked it. So I will update the patch.
So the question is will
> I bee able to use the printed string as an argument to -t ? Because on
> one hand I as a user would like to make sense of the output I'm seeing
> (hence the string is welcomed) at the same time I'd like to know that i
> can reference the tree with -t option without having to go and figure
> out what's the numeric id?
I looked the code and just now realized that we can already use tree name
for -t like "btrfs ins dump-tree -t EXTNET $DEV".
Please see treeid_from_string() in inspect-dump-tree.c.
>
>> break;
>> case BTRFS_SHARED_BLOCK_REF_KEY:
>> printf("\t\tshared block backref parent %llu\n",
>>
>
>
next prev parent reply other threads:[~2018-05-30 6:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 4:55 [PATCH 0/2] btrfs-progs: ins: dump-tree: Small updates for extent tree output Misono Tomohiro
2018-05-30 4:55 ` [PATCH 1/2] btrfs-progs: ins: dump-tree: Use %lld for extent data backref offset Misono Tomohiro
2018-05-30 4:55 ` [PATCH 2/2] btrfs-progs: ins: dump-tree: Print tree name for tree block backref Misono Tomohiro
2018-05-30 6:28 ` Nikolay Borisov
2018-05-30 6:55 ` Misono Tomohiro [this message]
2018-05-30 7:01 ` Nikolay Borisov
2018-05-30 7:25 ` [PATCH v2 2/2] btrfs-progs: ins: dump-tree: Print tree name for extent data/tree " Misono Tomohiro
2018-05-30 7:29 ` Nikolay Borisov
2018-05-31 12:06 ` [PATCH 0/2] btrfs-progs: ins: dump-tree: Small updates for extent tree output David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d56cfca8-c6f9-971c-315f-cdde23a71baf@jp.fujitsu.com \
--to=misono.tomohiro@jp.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).