summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/ec.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-18 21:07:25 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:54 -0400
commit4b1e669995a6c19f1e1cc8a600101edf7fe9277e (patch)
tree5473319bd7894eff6cfb8e55c2f6c2b4a3787811 /fs/bcachefs/ec.h
parentba7c37d330816bcc10c55c8eaab268afca2447e8 (diff)
downloadlinux-4b1e669995a6c19f1e1cc8a600101edf7fe9277e.tar.gz
linux-4b1e669995a6c19f1e1cc8a600101edf7fe9277e.tar.bz2
linux-4b1e669995a6c19f1e1cc8a600101edf7fe9277e.zip
bcachefs: Erasure coding: Track open stripes
This adds a new hash table for stripes being created or updated, instead of hackily relying on the stripes heap. This lets us reserve the slot for the new stripe up front, at the same time as we would pick an existing stripe - if we were updating an existing stripe - making the overall code more consistent. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.h')
-rw-r--r--fs/bcachefs/ec.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/bcachefs/ec.h b/fs/bcachefs/ec.h
index 37d42e2a4505..0a69114bb160 100644
--- a/fs/bcachefs/ec.h
+++ b/fs/bcachefs/ec.h
@@ -148,6 +148,10 @@ struct ec_stripe_new {
struct ec_stripe_head *h;
struct mutex lock;
struct list_head list;
+
+ struct hlist_node hash;
+ u64 idx;
+
struct closure iodone;
/* counts in flight writes, stripe is created when pin == 0 */