diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-26 22:27:10 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:20 -0400 |
commit | 13f914ecb99b84e6c10cbbeba375e41735239828 (patch) | |
tree | e03dfd38fbb1ae330aabc914bbe8d17af6c67562 /fs/bcachefs/buckets.c | |
parent | 36f035e90804d30dba4336daafe1b89c9a8ffe98 (diff) | |
download | lwn-13f914ecb99b84e6c10cbbeba375e41735239828.tar.gz lwn-13f914ecb99b84e6c10cbbeba375e41735239828.zip |
bcachefs: Kill bch2_ec_mem_alloc()
bch2_ec_mem_alloc() was only used by GC, and there's no real need to
preallocate the stripes radix tree since we can cope fine with memory
allocation failure when we use the radix tree. This deletes a fair bit
of code, and it's also needed for the upcoming patch because
bch2_btree_iter_peek_prev() won't be working before journal replay
completes (and using it was incorrect previously, as well).
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 917575597ce5..a0b455b343ac 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1094,7 +1094,11 @@ static int bch2_mark_stripe(struct btree_trans *trans, spin_unlock(&c->ec_stripes_heap_lock); } } else { - struct gc_stripe *m = genradix_ptr(&c->gc_stripes, idx); + struct gc_stripe *m = + genradix_ptr_alloc(&c->gc_stripes, idx, GFP_KERNEL); + + if (!m) + return -ENOMEM; /* * This will be wrong when we bring back runtime gc: we should |