diff options
Diffstat (limited to 'libbcachefs/btree_io.c')
-rw-r--r-- | libbcachefs/btree_io.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libbcachefs/btree_io.c b/libbcachefs/btree_io.c index 1aa94229..74ffad4c 100644 --- a/libbcachefs/btree_io.c +++ b/libbcachefs/btree_io.c @@ -627,7 +627,8 @@ static void btree_node_sort(struct bch_fs *c, struct btree *b, BUG_ON(vstruct_end(&out->keys) > (void *) out + (PAGE_SIZE << order)); if (sorting_entire_node) - bch2_time_stats_update(&c->btree_sort_time, start_time); + bch2_time_stats_update(&c->times[BCH_TIME_btree_sort], + start_time); /* Make sure we preserve bset journal_seq: */ for (t = b->set + start_idx; t < b->set + end_idx; t++) @@ -801,7 +802,7 @@ void bch2_btree_sort_into(struct bch_fs *c, &dst->format, true); - bch2_time_stats_update(&c->btree_sort_time, start_time); + bch2_time_stats_update(&c->times[BCH_TIME_btree_sort], start_time); set_btree_bset_end(dst, dst->set); @@ -877,7 +878,7 @@ void bch2_btree_init_next(struct bch_fs *c, struct btree *b, bne = want_new_bset(c, b); if (bne) - bch2_bset_init_next(b, &bne->keys); + bch2_bset_init_next(c, b, bne); bch2_btree_build_aux_trees(b); @@ -1382,7 +1383,7 @@ start: } } - bch2_time_stats_update(&c->btree_read_time, rb->start_time); + bch2_time_stats_update(&c->times[BCH_TIME_btree_read], rb->start_time); bio_put(&rb->bio); clear_btree_node_read_in_flight(b); wake_up_bit(&b->flags, BTREE_NODE_read_in_flight); @@ -1742,6 +1743,7 @@ void __bch2_btree_node_write(struct bch_fs *c, struct btree *b, BUG_ON((b->will_make_reachable != 0) != !b->written); BUG_ON(b->written >= c->opts.btree_node_size); + BUG_ON(b->written & (c->opts.block_size - 1)); BUG_ON(bset_written(b, btree_bset_last(b))); BUG_ON(le64_to_cpu(b->data->magic) != bset_magic(c)); BUG_ON(memcmp(&b->data->format, &b->format, sizeof(b->format))); @@ -1972,7 +1974,7 @@ bool bch2_btree_post_write_cleanup(struct bch_fs *c, struct btree *b) bne = want_new_bset(c, b); if (bne) - bch2_bset_init_next(b, &bne->keys); + bch2_bset_init_next(c, b, bne); bch2_btree_build_aux_trees(b); |