Commit 32de2ea0 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Rhashtable based buckets_in_flight for copygc

Previously, copygc used a fifo for tracking buckets in flight - this had
the disadvantage of being fixed size, since we pass references to
elements into the move code.

This restructures it to be a hash table and linked list, since with
erasure coding we need to be able to pipeline across an arbitrary number
of buckets.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6bdefe9c
......@@ -16,9 +16,20 @@ struct bch_move_stats {
atomic64_t sectors_raced;
};
struct move_bucket_in_flight {
struct move_bucket_key {
struct bpos bucket;
u8 gen;
};
struct move_bucket {
struct move_bucket_key k;
unsigned sectors;
};
struct move_bucket_in_flight {
struct move_bucket_in_flight *next;
struct rhash_head hash;
struct move_bucket bucket;
atomic_t count;
};
......
This diff is collapsed.
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