diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-16 14:23:27 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:50 -0400 |
commit | ffb7c3d370a104d14ad0658b359cdf04ae679f04 (patch) | |
tree | 8bc29b326f11dd7ef8a6cbe5065f3b361b11aefa /fs/bcachefs/ec.c | |
parent | ded54580bdf18ba3a2b38e7910c54b1c53f007c6 (diff) | |
download | lwn-ffb7c3d370a104d14ad0658b359cdf04ae679f04.tar.gz lwn-ffb7c3d370a104d14ad0658b359cdf04ae679f04.zip |
bcachefs: Add BCH_BKEY_PTRS_MAX
This now means "the maximum number of pointers within a bkey" - and
bch_devs_list is updated to use it instead of BCH_REPLICAS_MAX, since
stripes can contain more than BCH_REPLICAS_MAX pointers.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.c')
-rw-r--r-- | fs/bcachefs/ec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bcachefs/ec.c b/fs/bcachefs/ec.c index db1c652f1ed4..95abc00bd0e0 100644 --- a/fs/bcachefs/ec.c +++ b/fs/bcachefs/ec.c @@ -300,7 +300,7 @@ static unsigned ec_nr_failed(struct ec_stripe_buf *buf) static int ec_do_recov(struct bch_fs *c, struct ec_stripe_buf *buf) { struct bch_stripe *v = &buf->key.v; - unsigned i, failed[EC_STRIPE_MAX], nr_failed = 0; + unsigned i, failed[BCH_BKEY_PTRS_MAX], nr_failed = 0; unsigned nr_data = v->nr_blocks - v->nr_redundant; unsigned bytes = buf->size << 9; @@ -1101,7 +1101,7 @@ static int ec_new_stripe_alloc(struct bch_fs *c, struct ec_stripe_head *h) s->c = c; s->h = h; s->nr_data = min_t(unsigned, h->nr_active_devs, - EC_STRIPE_MAX) - h->redundancy; + BCH_BKEY_PTRS_MAX) - h->redundancy; s->nr_parity = h->redundancy; bch2_keylist_init(&s->keys, s->inline_keys); @@ -1211,13 +1211,13 @@ static int new_stripe_alloc_buckets(struct bch_fs *c, struct ec_stripe_head *h) struct open_bucket *ob; unsigned i, nr_have, nr_data = min_t(unsigned, h->nr_active_devs, - EC_STRIPE_MAX) - h->redundancy; + BCH_BKEY_PTRS_MAX) - h->redundancy; bool have_cache = true; int ret = 0; devs = h->devs; - for_each_set_bit(i, h->s->blocks_allocated, EC_STRIPE_MAX) { + for_each_set_bit(i, h->s->blocks_allocated, BCH_BKEY_PTRS_MAX) { __clear_bit(h->s->stripe.key.v.ptrs[i].dev, devs.d); --nr_data; } |