summaryrefslogtreecommitdiff
path: root/fs/bcachefs/data_update.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-12-31 18:16:17 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2025-03-14 21:02:11 -0400
commit3075e68d268844b50b7a8a078510d1c960a1325f (patch)
tree59efde38fd210588739d240ed1165f64168e8fcb /fs/bcachefs/data_update.c
parent50ca857457e0a983bc6f881fcb1c47f8322a2c48 (diff)
bcachefs: bch2_data_update_inflight_to_text()
Add a new helper for bch2_moving_ctxt_to_text(), which may be used to debug if moving_ios are getting stuck. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r--fs/bcachefs/data_update.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c
index e2050256136e..1cfb86823fdf 100644
--- a/fs/bcachefs/data_update.c
+++ b/fs/bcachefs/data_update.c
@@ -430,6 +430,8 @@ int bch2_data_update_index_update(struct bch_write_op *op)
void bch2_data_update_read_done(struct data_update *m,
struct bch_extent_crc_unpacked crc)
{
+ m->read_done = true;
+
/* write bio must own pages: */
BUG_ON(!m->op.wbio.bio.bi_vcnt);
@@ -541,7 +543,8 @@ void bch2_data_update_opts_to_text(struct printbuf *out, struct bch_fs *c,
struct bch_io_opts *io_opts,
struct data_update_opts *data_opts)
{
- printbuf_tabstop_push(out, 20);
+ if (!out->nr_tabstops)
+ printbuf_tabstop_push(out, 20);
prt_str_indented(out, "rewrite ptrs:\t");
bch2_prt_u64_base2(out, data_opts->rewrite_ptrs);
@@ -565,6 +568,7 @@ void bch2_data_update_opts_to_text(struct printbuf *out, struct bch_fs *c,
prt_str_indented(out, "extra replicas:\t");
prt_u64(out, data_opts->extra_replicas);
+ prt_newline(out);
}
void bch2_data_update_to_text(struct printbuf *out, struct data_update *m)
@@ -576,6 +580,17 @@ void bch2_data_update_to_text(struct printbuf *out, struct data_update *m)
bch2_bkey_val_to_text(out, m->op.c, bkey_i_to_s_c(m->k.k));
}
+void bch2_data_update_inflight_to_text(struct printbuf *out, struct data_update *m)
+{
+ bch2_bkey_val_to_text(out, m->op.c, bkey_i_to_s_c(m->k.k));
+ prt_newline(out);
+ printbuf_indent_add(out, 2);
+ bch2_data_update_opts_to_text(out, m->op.c, &m->op.opts, &m->data_opts);
+ prt_printf(out, "read_done:\t\%u\n", m->read_done);
+ bch2_write_op_to_text(out, &m->op);
+ printbuf_indent_sub(out, 2);
+}
+
int bch2_extent_drop_ptrs(struct btree_trans *trans,
struct btree_iter *iter,
struct bkey_s_c k,