summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-07-07 05:33:54 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:42 +0300
commitf6b94a3baa956ff10a52a545a9ad60f35e88e683 (patch)
treeb973107ffc3a29c6dd0febbb7b8c42faa7bb2e97 /fs/bcachefs/ec.h
parent703e2a43bf30c1d5610fa7d1a823911d96487dac (diff)
downloadlinux-f6b94a3baa956ff10a52a545a9ad60f35e88e683.tar.xz
bcachefs: Refactor stripe creation
Prep work for the patch to update existing stripes with new data blocks. This moves allocating new stripes into ec.c, and also sets up the data structures so that we can handly only allocating some of the blocks in a 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, 5 insertions, 1 deletions
diff --git a/fs/bcachefs/ec.h b/fs/bcachefs/ec.h
index 6f9354f82656..d7396885792e 100644
--- a/fs/bcachefs/ec.h
+++ b/fs/bcachefs/ec.h
@@ -92,11 +92,15 @@ struct ec_stripe_new {
atomic_t pin;
int err;
- bool pending;
+ u8 nr_data;
+ u8 nr_parity;
+ bool allocated;
+ bool pending;
unsigned long blocks_allocated[BITS_TO_LONGS(EC_STRIPE_MAX)];
struct open_buckets blocks;
+ u8 data_block_idx[EC_STRIPE_MAX];
struct open_buckets parity;
struct keylist keys;