aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-02-17 03:26:19 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-03-13 21:22:25 -0400
commit06d493fee43be69580082f7b9b48c4d3f9c9de64 (patch)
tree2df9627f1f30f45fe1d3bbdfefc74eb4e909ff4f /fs/bcachefs
parent29e11f96993dd10210bfda0e09f43f307afc3639 (diff)
downloadlinux-06d493fee43be69580082f7b9b48c4d3f9c9de64.tar.gz
bcachefs: improve bch2_journal_buf_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/journal.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index f5be8e417c8a6..597733a84d380 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -53,33 +53,48 @@ static void bch2_journal_buf_to_text(struct printbuf *out, struct journal *j, u6
unsigned i = seq & JOURNAL_BUF_MASK;
struct journal_buf *buf = j->buf + i;
- prt_printf(out, "seq:");
+ prt_str(out, "seq:");
prt_tab(out);
prt_printf(out, "%llu", seq);
prt_newline(out);
printbuf_indent_add(out, 2);
- prt_printf(out, "refcount:");
+ prt_str(out, "refcount:");
prt_tab(out);
prt_printf(out, "%u", journal_state_count(s, i));
prt_newline(out);
- prt_printf(out, "size:");
+ prt_str(out, "size:");
prt_tab(out);
prt_human_readable_u64(out, vstruct_bytes(buf->data));
prt_newline(out);
- prt_printf(out, "expires");
+ prt_str(out, "expires:");
prt_tab(out);
prt_printf(out, "%li jiffies", buf->expires - jiffies);
prt_newline(out);
+ prt_str(out, "flags:");
+ prt_tab(out);
+ if (buf->noflush)
+ prt_str(out, "noflush ");
+ if (buf->must_flush)
+ prt_str(out, "must_flush ");
+ if (buf->separate_flush)
+ prt_str(out, "separate_flush ");
+ if (buf->need_flush_to_write_buffer)
+ prt_str(out, "need_flush_to_write_buffer ");
+ if (buf->need_flush_to_write_buffer)
+ prt_str(out, "need_flush_to_write_buffer ");
+ if (buf->write_done)
+ prt_str(out, "write done ");
+ if (buf->write_started)
+ prt_str(out, "write started ");
+ if (buf->write_allocated)
+ prt_str(out, "write allocated ");
if (buf->write_done)
- prt_printf(out, "write done\n");
- else if (buf->write_allocated)
- prt_printf(out, "write allocated\n");
- else if (buf->write_started)
- prt_printf(out, "write started\n");
+ prt_str(out, "write done");
+ prt_newline(out);
printbuf_indent_sub(out, 2);
}