Skip to content

Commit 249f441

Browse files
author
Kent Overstreet
committed
bcachefs: Improve inode_to_text()
Add line breaks - inode_to_text() is now much easier to read. Signed-off-by: Kent Overstreet <[email protected]>
1 parent d826cc5 commit 249f441

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

fs/bcachefs/inode.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,22 +506,33 @@ int bch2_inode_v3_invalid(struct bch_fs *c, struct bkey_s_c k,
506506
static void __bch2_inode_unpacked_to_text(struct printbuf *out,
507507
struct bch_inode_unpacked *inode)
508508
{
509-
prt_printf(out, "mode=%o ", inode->bi_mode);
509+
printbuf_indent_add(out, 2);
510+
prt_printf(out, "mode=%o", inode->bi_mode);
511+
prt_newline(out);
510512

511513
prt_str(out, "flags=");
512514
prt_bitflags(out, bch2_inode_flag_strs, inode->bi_flags & ((1U << 20) - 1));
513515
prt_printf(out, " (%x)", inode->bi_flags);
516+
prt_newline(out);
514517

515-
prt_printf(out, " journal_seq=%llu bi_size=%llu bi_sectors=%llu bi_version=%llu",
516-
inode->bi_journal_seq,
517-
inode->bi_size,
518-
inode->bi_sectors,
519-
inode->bi_version);
518+
prt_printf(out, "journal_seq=%llu", inode->bi_journal_seq);
519+
prt_newline(out);
520+
521+
prt_printf(out, "bi_size=%llu", inode->bi_size);
522+
prt_newline(out);
523+
524+
prt_printf(out, "bi_sectors=%llu", inode->bi_sectors);
525+
prt_newline(out);
526+
527+
prt_newline(out);
528+
prt_printf(out, "bi_version=%llu", inode->bi_version);
520529

521530
#define x(_name, _bits) \
522-
prt_printf(out, " "#_name "=%llu", (u64) inode->_name);
531+
prt_printf(out, #_name "=%llu", (u64) inode->_name); \
532+
prt_newline(out);
523533
BCH_INODE_FIELDS_v3()
524534
#undef x
535+
printbuf_indent_sub(out, 2);
525536
}
526537

527538
void bch2_inode_unpacked_to_text(struct printbuf *out, struct bch_inode_unpacked *inode)

0 commit comments

Comments
 (0)