diff options
Diffstat (limited to 'libbcachefs/data_update.c')
-rw-r--r-- | libbcachefs/data_update.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libbcachefs/data_update.c b/libbcachefs/data_update.c index 3b442b01..cb25efb6 100644 --- a/libbcachefs/data_update.c +++ b/libbcachefs/data_update.c @@ -231,9 +231,12 @@ static int bch2_data_update_index_update(struct bch_write_op *op) m->data_opts.btree_insert_flags); if (!ret) { bch2_btree_iter_set_pos(&iter, next_pos); - atomic_long_inc(&c->extent_migrate_done); + if (ec_ob) bch2_ob_add_backpointer(c, ec_ob, &insert->k); + + this_cpu_add(c->counters[BCH_COUNTER_move_extent_finish], new->k.size); + trace_move_extent_finish(&new->k); } err: if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) @@ -248,22 +251,16 @@ next: } continue; nomatch: - if (IS_ENABLED(CONFIG_BCACHEFS_DEBUG)) { - struct printbuf buf = PRINTBUF; - - bch2_bkey_val_to_text(&buf, c, old); - bch_info(c, "no match for %s", buf.buf); - printbuf_exit(&buf); - } - if (m->ctxt) { BUG_ON(k.k->p.offset <= iter.pos.offset); atomic64_inc(&m->ctxt->stats->keys_raced); atomic64_add(k.k->p.offset - iter.pos.offset, &m->ctxt->stats->sectors_raced); } - atomic_long_inc(&c->extent_migrate_raced); - trace_move_race(&new->k); + + this_cpu_add(c->counters[BCH_COUNTER_move_extent_race], new->k.size); + trace_move_extent_race(&new->k); + bch2_btree_iter_advance(&iter); goto next; } |