bcachefs: Delete in memory ec backpointers
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 9 Oct 2022 04:47:18 +0000 (00:47 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:51 +0000 (17:09 -0400)
Post btree backpointers, these aren't needed anymore.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/data_update.c
fs/bcachefs/ec.c
fs/bcachefs/ec.h
fs/bcachefs/io.c

index acb634b3480ba757bcadf1708dbdab86d521138f..d2b1296c4c49a7c9fd6983ac28097fe9c8fe1d90 100644 (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);
                }
index 68f5314b51e6a31d6edc230e96a78da5153c22c9..c7ac2894db2eb648d5b0e9205968f440a030d385 100644 (file)
@@ -1035,8 +1035,6 @@ err:
                        }
                }
 
-       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);
 
index 4d4e3756dd59bd0dbfc82643d2dc4078731f0210..5587c9467fb51b3f72ba48eeb6f3d53319e67e34 100644 (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 *);
index b57187ce1f653f831581bb778dbfad4950e4fd5c..a937940f509600ddf9410a68ace7102179b2a4e5 100644 (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