Commit 249f441f authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Improve inode_to_text()

Add line breaks - inode_to_text() is now much easier to read.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent d826cc57
...@@ -506,22 +506,33 @@ int bch2_inode_v3_invalid(struct bch_fs *c, struct bkey_s_c k, ...@@ -506,22 +506,33 @@ int bch2_inode_v3_invalid(struct bch_fs *c, struct bkey_s_c k,
static void __bch2_inode_unpacked_to_text(struct printbuf *out, static void __bch2_inode_unpacked_to_text(struct printbuf *out,
struct bch_inode_unpacked *inode) struct bch_inode_unpacked *inode)
{ {
prt_printf(out, "mode=%o ", inode->bi_mode); printbuf_indent_add(out, 2);
prt_printf(out, "mode=%o", inode->bi_mode);
prt_newline(out);
prt_str(out, "flags="); prt_str(out, "flags=");
prt_bitflags(out, bch2_inode_flag_strs, inode->bi_flags & ((1U << 20) - 1)); prt_bitflags(out, bch2_inode_flag_strs, inode->bi_flags & ((1U << 20) - 1));
prt_printf(out, " (%x)", inode->bi_flags); prt_printf(out, " (%x)", inode->bi_flags);
prt_newline(out);
prt_printf(out, " journal_seq=%llu bi_size=%llu bi_sectors=%llu bi_version=%llu", prt_printf(out, "journal_seq=%llu", inode->bi_journal_seq);
inode->bi_journal_seq, prt_newline(out);
inode->bi_size,
inode->bi_sectors, prt_printf(out, "bi_size=%llu", inode->bi_size);
inode->bi_version); prt_newline(out);
prt_printf(out, "bi_sectors=%llu", inode->bi_sectors);
prt_newline(out);
prt_newline(out);
prt_printf(out, "bi_version=%llu", inode->bi_version);
#define x(_name, _bits) \ #define x(_name, _bits) \
prt_printf(out, " "#_name "=%llu", (u64) inode->_name); prt_printf(out, #_name "=%llu", (u64) inode->_name); \
prt_newline(out);
BCH_INODE_FIELDS_v3() BCH_INODE_FIELDS_v3()
#undef x #undef x
printbuf_indent_sub(out, 2);
} }
void bch2_inode_unpacked_to_text(struct printbuf *out, struct bch_inode_unpacked *inode) void bch2_inode_unpacked_to_text(struct printbuf *out, struct bch_inode_unpacked *inode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment