Skip to contentSkip to conversation

bcachefs: Align the display format of `btrees/inodes/keys`

PATCH In review Youling Tang 2 participants 2 messages Apr 18, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bcachefs: Align the display format of `btrees/inodes/keys`

From: Youling Tang <[email protected]>

Before patch:

```
 #cat btrees/inodes/keys
 u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0:   mode=40755
   flags= (16300000)
   bi_size=0
```

After patch:

```
 #cat btrees/inodes/keys
 u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0:
   mode=40755
   flags=(16300000)
   bi_size=0
```

---
v2:
- Adjust where to add new lines of code.
- Remove flags ` ` by Hongbo suggestion.

 fs/bcachefs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/bcachefs/inode.c +2 -1
index f0da2b0048cc..5c9ee41baa72 100644
@@ -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);
 
 	prt_printf(out, "journal_seq=%llu\n",	inode->bi_journal_seq);
 	prt_printf(out, "bi_size=%llu\n",	inode->bi_size);
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 37 lines · Youling Tang

From: Youling Tang <[email protected]>

Before patch:

```
  #cat btrees/inodes/keys
  u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0:   mode=40755
    flags= (16300000)
    bi_size=0
```

After patch:

```
  #cat btrees/inodes/keys
  u64s 17 type inode_v3 0:4096:U32_MAX len 0 ver 0:
    mode=40755
    flags=(16300000)
    bi_size=0
```

---
v2:
- Adjust where to add new lines of code.
- Remove flags ` ` by Hongbo suggestion.

  fs/bcachefs/inode.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
fs/bcachefs/inode.c +1 -0
index f0da2b0048cc..5c9ee41baa72 100644
@@ -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");

fs/bcachefs/inode.c int bch2_inode_v3_invalid(struct bch_fs *c, struct bkey_s_c k, · line 546

Quoted 10 lines
fs/bcachefs/inode.c +1 -1
  	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);
 
  	prt_printf(out, "journal_seq=%llu\n",	inode->bi_journal_seq);
  	prt_printf(out, "bi_size=%llu\n",	inode->bi_size);

Thanks.
Hongbo Li