bcachefs: Delete in memory ec backpointers

Post btree backpointers, these aren't needed anymore.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2022-10-09 00:47:18 -04:00
parent dea5647e16
commit c9828cea31
4 changed files with 0 additions and 42 deletions

View file

@ -103,7 +103,6 @@ int bch2_data_update_index_update(struct bch_write_op *op)
struct btree_iter iter;
struct data_update *m =
container_of(op, struct data_update, op);
struct open_bucket *ec_ob = ec_open_bucket(c, &op->open_buckets);
struct keylist *keys = &op->insert_keys;
struct bkey_buf _new, _insert;
int ret = 0;
@ -242,9 +241,6 @@ int bch2_data_update_index_update(struct bch_write_op *op)
if (!ret) {
bch2_btree_iter_set_pos(&iter, next_pos);
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);
}

View file

@ -1035,8 +1035,6 @@ static void ec_stripe_create(struct ec_stripe_new *s)
}
}
bch2_keylist_free(&s->keys, s->inline_keys);
ec_stripe_buf_exit(&s->existing_stripe);
ec_stripe_buf_exit(&s->new_stripe);
closure_debug_destroy(&s->iodone);
@ -1119,30 +1117,6 @@ void *bch2_writepoint_ec_buf(struct bch_fs *c, struct write_point *wp)
return ob->ec->new_stripe.data[ob->ec_idx] + (offset << 9);
}
void bch2_ob_add_backpointer(struct bch_fs *c, struct open_bucket *ob,
struct bkey *k)
{
struct ec_stripe_new *ec = ob->ec;
if (!ec)
return;
mutex_lock(&ec->lock);
if (bch2_keylist_realloc(&ec->keys, ec->inline_keys,
ARRAY_SIZE(ec->inline_keys),
BKEY_U64s)) {
BUG();
}
bkey_init(&ec->keys.top->k);
ec->keys.top->k.p = k->p;
ec->keys.top->k.size = k->size;
bch2_keylist_push(&ec->keys);
mutex_unlock(&ec->lock);
}
static int unsigned_cmp(const void *_l, const void *_r)
{
unsigned l = *((const unsigned *) _l);
@ -1235,8 +1209,6 @@ static int ec_new_stripe_alloc(struct bch_fs *c, struct ec_stripe_head *h)
BCH_BKEY_PTRS_MAX) - h->redundancy;
s->nr_parity = h->redundancy;
bch2_keylist_init(&s->keys, s->inline_keys);
ec_stripe_key_init(c, &s->new_stripe.key, s->nr_data,
s->nr_parity, h->blocksize);

View file

@ -5,7 +5,6 @@
#include "ec_types.h"
#include "buckets_types.h"
#include "extents_types.h"
#include "keylist_types.h"
int bch2_stripe_invalid(const struct bch_fs *, struct bkey_s_c,
int rw, struct printbuf *);
@ -167,9 +166,6 @@ struct ec_stripe_new {
open_bucket_idx_t blocks[BCH_BKEY_PTRS_MAX];
struct disk_reservation res;
struct keylist keys;
u64 inline_keys[BKEY_U64s * 8];
struct ec_stripe_buf new_stripe;
struct ec_stripe_buf existing_stripe;
};
@ -197,8 +193,6 @@ struct ec_stripe_head {
int bch2_ec_read_extent(struct bch_fs *, struct bch_read_bio *);
void *bch2_writepoint_ec_buf(struct bch_fs *, struct write_point *);
void bch2_ob_add_backpointer(struct bch_fs *, struct open_bucket *,
struct bkey *);
void bch2_ec_bucket_written(struct bch_fs *, struct open_bucket *);
void bch2_ec_bucket_cancel(struct bch_fs *, struct open_bucket *);

View file

@ -472,7 +472,6 @@ static int bch2_write_index_default(struct bch_write_op *op)
{
struct bch_fs *c = op->c;
struct bkey_buf sk;
struct open_bucket *ec_ob = ec_open_bucket(c, &op->open_buckets);
struct keylist *keys = &op->insert_keys;
struct bkey_i *k = bch2_keylist_front(keys);
struct btree_trans trans;
@ -516,9 +515,6 @@ static int bch2_write_index_default(struct bch_write_op *op)
if (ret)
break;
if (ec_ob)
bch2_ob_add_backpointer(c, ec_ob, &sk.k->k);
if (bkey_ge(iter.pos, k->k.p))
bch2_keylist_pop_front(&op->insert_keys);
else