lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] bcachefs: Align the display format of `btrees/inodes/keys`
From
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)
> 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?
--- 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.

\
 
 \ /
  Last update: 2024-04-17 04:50    [W:0.037 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site