From: Youling Tang <youling.tang@linux.dev>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Hongbo Li <lihongbo22@huawei.com>,
linux-bcachefs@vger.kernel.org, linux-kernel@vger.kernel.org,
Youling Tang <tangyouling@kylinos.cn>
Subject: Re: [PATCH] bcachefs: Align the display format of `btrees/inodes/keys`
Date: Wed, 17 Apr 2024 13:51:21 +0800 [thread overview]
Message-ID: <63d9540f-61bc-4eba-819c-c05d2e486bdb@linux.dev> (raw)
In-Reply-To: <29d5ea19-21b5-4076-9acc-8286a050c33f@huawei.com>
Hi, Kent & Hongbo
On 17/04/2024 11:21, Hongbo Li wrote:
>
>
> On 2024/4/17 11:16, Hongbo Li wrote:
>>
>>
>> On 2024/4/17 10:59, Kent Overstreet wrote:
>>> On Wed, Apr 17, 2024 at 10:50:10AM +0800, Youling Tang wrote:
>>>> Hi, Kent
>>>> On 17/04/2024 10:20, Kent Overstreet wrote:
>>>>> On Wed, Apr 17, 2024 at 09:54:48AM +0800, Youling Tang wrote:
>>>>>> From: Youling Tang <tangyouling@kylinos.cn>
>>>>>>
>>>>>> Before patch:
>>>>>> ```
>>>>>> #cat btrees/inodes/keys
>>>>>> u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0: mode=40755
>>>>>> flags= (16300000)
>>>>>> ```
>>>>>>
>>>>>> After patch:
>>>>>> ```
>>>>>> #cat btrees/inodes/keys
>>>>>> u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0:
>>>>>> mode=40755
>>>>>> flags= (16300000)
>> The flags also with the space after "=". Is it reseonable?
> Sorry, I misspell. I mean whether it is reasonable.
>>>>> This would print a newline for keys that don't have a value...
>>>> The original intention was to make the display of the printed
>>>> content in
>>>> '__bch2_inode_unpacked_to_text ()' consistent, without considering
>>>> other
>>>> callbacks.
>>>>
>>>> Or just modify it in the following way?
>>>
>>> Yeah, that's better
>>>
>>> Do it off my master branch though, there's some printbuf
>>> imprevements in
>>> there.
>>>
>>> https://evilpiepirate.org/git/bcachefs.git
I will make the following changes based on the master branch,
--- a/fs/bcachefs/inode.c
+++ b/fs/bcachefs/inode.c
@@ -534,12 +534,13 @@ int bch2_inode_v3_invalid(struct bch_fs *c, struct
bkey_s_c k,
static void __bch2_inode_unpacked_to_text(struct printbuf *out,
struct bch_inode_unpacked *inode)
{
+ prt_printf(out, "\n");
printbuf_indent_add(out, 2);
prt_printf(out, "mode=%o\n", inode->bi_mode);
prt_str(out, "flags=");
prt_bitflags(out, bch2_inode_flag_strs, inode->bi_flags & ((1U
<< 20) - 1));
- prt_printf(out, " (%x)\n", inode->bi_flags);
+ prt_printf(out, "(%x)\n", inode->bi_flags);
>>>
>>>> --- a/fs/bcachefs/inode.c
>>>> +++ b/fs/bcachefs/inode.c
>>>> @@ -534,6 +534,8 @@ int bch2_inode_v3_invalid(struct bch_fs *c, struct
>>>> bkey_s_c k,
>>>> static void __bch2_inode_unpacked_to_text(struct printbuf *out,
>>>> struct bch_inode_unpacked *inode)
>>>> {
>>>> + prt_newline(out);
>>>> +
>>>> printbuf_indent_add(out, 2);
>>>> prt_printf(out, "mode=%o", inode->bi_mode);
>>>> prt_newline(out);
>>>>
>>>>
>>>> Thanks,
>>>> Youling.
>>>
>>
next prev parent reply other threads:[~2024-04-17 5:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 1:54 [PATCH] bcachefs: Align the display format of `btrees/inodes/keys` Youling Tang
2024-04-17 2:20 ` Kent Overstreet
2024-04-17 2:50 ` Youling Tang
2024-04-17 2:59 ` Kent Overstreet
2024-04-17 3:16 ` Hongbo Li
2024-04-17 3:21 ` Hongbo Li
2024-04-17 5:51 ` Youling Tang [this message]
2024-04-17 9:49 ` Hongbo Li
2024-04-17 10:05 ` Kent Overstreet
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=63d9540f-61bc-4eba-819c-c05d2e486bdb@linux.dev \
--to=youling.tang@linux.dev \
--cc=kent.overstreet@linux.dev \
--cc=lihongbo22@huawei.com \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tangyouling@kylinos.cn \
/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