summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_gc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-06-08 02:53:02 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2024-07-15 01:00:15 +0200
commitdd3995a6a4fcf041297d73fb7a12c6edde339986 (patch)
treed10cf008932179f327b5ef8a8f65a56b0c3515db /fs/bcachefs/btree_gc.c
parentbcachefs: bch2_btree_id_to_text() (diff)
downloadlinux-dd3995a6a4fcf041297d73fb7a12c6edde339986.tar.xz
linux-dd3995a6a4fcf041297d73fb7a12c6edde339986.zip
bcachefs: bch2_gc_pos_to_text()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_gc.c')
-rw-r--r--fs/bcachefs/btree_gc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index dfc842d6e822..b712620a1703 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -45,6 +45,22 @@
#define DROP_PREV_NODE 11
#define DID_FILL_FROM_SCAN 12
+static const char * const bch2_gc_phase_strs[] = {
+#define x(n) #n,
+ GC_PHASES()
+#undef x
+ NULL
+};
+
+void bch2_gc_pos_to_text(struct printbuf *out, struct gc_pos *p)
+{
+ prt_str(out, bch2_gc_phase_strs[p->phase]);
+ prt_char(out, ' ');
+ bch2_btree_id_to_text(out, p->btree);
+ prt_printf(out, " l=%u ", p->level);
+ bch2_bpos_to_text(out, p->pos);
+}
+
static struct bkey_s unsafe_bkey_s_c_to_s(struct bkey_s_c k)
{
return (struct bkey_s) {{{