summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-01-19 07:26:42 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:51 +0300
commit6c7585b098c519c157cca4ca1c974321f3903ad4 (patch)
treee675e6afe431a8d08adc0f8a1052474a56dcbfa8 /fs/bcachefs/ec.h
parentf9ef45ad434ba85363aab6d74fa48499f7ea6499 (diff)
downloadlinux-6c7585b098c519c157cca4ca1c974321f3903ad4.tar.xz
bcachefs: Rework allocating buckets for stripes
Allocating buckets for existing stripes was busted, in part because the data structures were too contorted. This reworks new stripes so that we have an array of open buckets that matches blocks in the stripe, and it's sparse if we're reusing an existing stripe. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.h')
-rw-r--r--fs/bcachefs/ec.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/ec.h b/fs/bcachefs/ec.h
index f124582fdc5f..765baa9d9264 100644
--- a/fs/bcachefs/ec.h
+++ b/fs/bcachefs/ec.h
@@ -143,11 +143,9 @@ struct ec_stripe_new {
bool pending;
bool have_existing_stripe;
+ unsigned long blocks_gotten[BITS_TO_LONGS(BCH_BKEY_PTRS_MAX)];
unsigned long blocks_allocated[BITS_TO_LONGS(BCH_BKEY_PTRS_MAX)];
-
- struct open_buckets blocks;
- u8 data_block_idx[BCH_BKEY_PTRS_MAX];
- struct open_buckets parity;
+ open_bucket_idx_t blocks[BCH_BKEY_PTRS_MAX];
struct disk_reservation res;
struct keylist keys;