Commit c9828cea authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Delete in memory ec backpointers

Post btree backpointers, these aren't needed anymore.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent dea5647e
...@@ -103,7 +103,6 @@ int bch2_data_update_index_update(struct bch_write_op *op) ...@@ -103,7 +103,6 @@ int bch2_data_update_index_update(struct bch_write_op *op)
struct btree_iter iter; struct btree_iter iter;
struct data_update *m = struct data_update *m =
container_of(op, struct data_update, op); 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 keylist *keys = &op->insert_keys;
struct bkey_buf _new, _insert; struct bkey_buf _new, _insert;
int ret = 0; int ret = 0;
...@@ -242,9 +241,6 @@ int bch2_data_update_index_update(struct bch_write_op *op) ...@@ -242,9 +241,6 @@ int bch2_data_update_index_update(struct bch_write_op *op)
if (!ret) { if (!ret) {
bch2_btree_iter_set_pos(&iter, next_pos); 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); this_cpu_add(c->counters[BCH_COUNTER_move_extent_finish], new->k.size);
trace_move_extent_finish(&new->k); trace_move_extent_finish(&new->k);
} }
......
...@@ -1035,8 +1035,6 @@ static void ec_stripe_create(struct ec_stripe_new *s) ...@@ -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->existing_stripe);
ec_stripe_buf_exit(&s->new_stripe); ec_stripe_buf_exit(&s->new_stripe);
closure_debug_destroy(&s->iodone); closure_debug_destroy(&s->iodone);
...@@ -1119,30 +1117,6 @@ void *bch2_writepoint_ec_buf(struct bch_fs *c, struct write_point *wp) ...@@ -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); 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) static int unsigned_cmp(const void *_l, const void *_r)
{ {
unsigned l = *((const unsigned *) _l); unsigned l = *((const unsigned *) _l);
...@@ -1235,8 +1209,6 @@ static int ec_new_stripe_alloc(struct bch_fs *c, struct ec_stripe_head *h) ...@@ -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; BCH_BKEY_PTRS_MAX) - h->redundancy;
s->nr_parity = 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, ec_stripe_key_init(c, &s->new_stripe.key, s->nr_data,
s->nr_parity, h->blocksize); s->nr_parity, h->blocksize);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "ec_types.h" #include "ec_types.h"
#include "buckets_types.h" #include "buckets_types.h"
#include "extents_types.h" #include "extents_types.h"
#include "keylist_types.h"
int bch2_stripe_invalid(const struct bch_fs *, struct bkey_s_c, int bch2_stripe_invalid(const struct bch_fs *, struct bkey_s_c,
int rw, struct printbuf *); int rw, struct printbuf *);
...@@ -167,9 +166,6 @@ struct ec_stripe_new { ...@@ -167,9 +166,6 @@ struct ec_stripe_new {
open_bucket_idx_t blocks[BCH_BKEY_PTRS_MAX]; open_bucket_idx_t blocks[BCH_BKEY_PTRS_MAX];
struct disk_reservation res; struct disk_reservation res;
struct keylist keys;
u64 inline_keys[BKEY_U64s * 8];
struct ec_stripe_buf new_stripe; struct ec_stripe_buf new_stripe;
struct ec_stripe_buf existing_stripe; struct ec_stripe_buf existing_stripe;
}; };
...@@ -197,8 +193,6 @@ struct ec_stripe_head { ...@@ -197,8 +193,6 @@ struct ec_stripe_head {
int bch2_ec_read_extent(struct bch_fs *, struct bch_read_bio *); 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_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_written(struct bch_fs *, struct open_bucket *);
void bch2_ec_bucket_cancel(struct bch_fs *, struct open_bucket *); void bch2_ec_bucket_cancel(struct bch_fs *, struct open_bucket *);
......
...@@ -472,7 +472,6 @@ static int bch2_write_index_default(struct bch_write_op *op) ...@@ -472,7 +472,6 @@ static int bch2_write_index_default(struct bch_write_op *op)
{ {
struct bch_fs *c = op->c; struct bch_fs *c = op->c;
struct bkey_buf sk; struct bkey_buf sk;
struct open_bucket *ec_ob = ec_open_bucket(c, &op->open_buckets);
struct keylist *keys = &op->insert_keys; struct keylist *keys = &op->insert_keys;
struct bkey_i *k = bch2_keylist_front(keys); struct bkey_i *k = bch2_keylist_front(keys);
struct btree_trans trans; struct btree_trans trans;
...@@ -516,9 +515,6 @@ static int bch2_write_index_default(struct bch_write_op *op) ...@@ -516,9 +515,6 @@ static int bch2_write_index_default(struct bch_write_op *op)
if (ret) if (ret)
break; break;
if (ec_ob)
bch2_ob_add_backpointer(c, ec_ob, &sk.k->k);
if (bkey_ge(iter.pos, k->k.p)) if (bkey_ge(iter.pos, k->k.p))
bch2_keylist_pop_front(&op->insert_keys); bch2_keylist_pop_front(&op->insert_keys);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment