summaryrefslogtreecommitdiff
path: root/fs/bcachefs/data_update.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r--fs/bcachefs/data_update.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c
index 3968f3be7f3b..ccedc93fe0ef 100644
--- a/fs/bcachefs/data_update.c
+++ b/fs/bcachefs/data_update.c
@@ -115,7 +115,7 @@ static void trace_io_move_finish2(struct data_update *u,
struct bkey_i *insert)
{
struct bch_fs *c = u->op.c;
- struct printbuf buf = PRINTBUF;
+ CLASS(printbuf, buf)();
prt_newline(&buf);
@@ -131,7 +131,6 @@ static void trace_io_move_finish2(struct data_update *u,
prt_newline(&buf);
trace_io_move_finish(c, buf.buf);
- printbuf_exit(&buf);
}
noinline_for_stack
@@ -143,7 +142,7 @@ static void trace_io_move_fail2(struct data_update *m,
{
struct bch_fs *c = m->op.c;
struct bkey_s_c old = bkey_i_to_s_c(m->k.k);
- struct printbuf buf = PRINTBUF;
+ CLASS(printbuf, buf)();
unsigned rewrites_found = 0;
if (!trace_io_move_fail_enabled())
@@ -187,7 +186,6 @@ static void trace_io_move_fail2(struct data_update *m,
}
trace_io_move_fail(c, buf.buf);
- printbuf_exit(&buf);
}
noinline_for_stack
@@ -196,7 +194,7 @@ static void trace_data_update2(struct data_update *m,
struct bkey_i *insert)
{
struct bch_fs *c = m->op.c;
- struct printbuf buf = PRINTBUF;
+ CLASS(printbuf, buf)();
prt_str(&buf, "\nold: ");
bch2_bkey_val_to_text(&buf, c, old);
@@ -206,7 +204,6 @@ static void trace_data_update2(struct data_update *m,
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(insert));
trace_data_update(c, buf.buf);
- printbuf_exit(&buf);
}
noinline_for_stack
@@ -215,7 +212,7 @@ static void trace_io_move_created_rebalance2(struct data_update *m,
struct bkey_i *insert)
{
struct bch_fs *c = m->op.c;
- struct printbuf buf = PRINTBUF;
+ CLASS(printbuf, buf)();
bch2_data_update_opts_to_text(&buf, c, &m->op.opts, &m->data_opts);
@@ -227,7 +224,6 @@ static void trace_io_move_created_rebalance2(struct data_update *m,
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(insert));
trace_io_move_created_rebalance(c, buf.buf);
- printbuf_exit(&buf);
this_cpu_inc(c->counters[BCH_COUNTER_io_move_created_rebalance]);
}
@@ -238,7 +234,7 @@ static int data_update_invalid_bkey(struct data_update *m,
struct bkey_i *insert)
{
struct bch_fs *c = m->op.c;
- struct printbuf buf = PRINTBUF;
+ CLASS(printbuf, buf)();
bch2_log_msg_start(c, &buf);
prt_str(&buf, "about to insert invalid key in data update path");
@@ -254,7 +250,6 @@ static int data_update_invalid_bkey(struct data_update *m,
bch2_fs_emergency_read_only2(c, &buf);
bch2_print_str(c, KERN_ERR, buf.buf);
- printbuf_exit(&buf);
return bch_err_throw(c, invalid_bkey);
}
@@ -499,7 +494,8 @@ out:
int bch2_data_update_index_update(struct bch_write_op *op)
{
- return bch2_trans_run(op->c, __bch2_data_update_index_update(trans, op));
+ CLASS(btree_trans, trans)(op->c);
+ return __bch2_data_update_index_update(trans, op);
}
void bch2_data_update_read_done(struct data_update *m)
@@ -675,7 +671,7 @@ void bch2_data_update_inflight_to_text(struct printbuf *out, struct data_update
if (!m->read_done) {
prt_printf(out, "read:\n");
printbuf_indent_add(out, 2);
- bch2_read_bio_to_text(out, &m->rbio);
+ bch2_read_bio_to_text(out, m->op.c, &m->rbio);
} else {
prt_printf(out, "write:\n");
printbuf_indent_add(out, 2);
@@ -784,8 +780,8 @@ static int can_write_extent(struct bch_fs *c, struct data_update *m)
__clear_bit(*i, devs.d);
CLASS(printbuf, buf)();
- buf.atomic++;
+ guard(printbuf_atomic)(&buf);
guard(rcu)();
unsigned nr_replicas = 0, i;