summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/ec.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-05 23:52:49 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:56 -0400
commit2a912a9a39bf0ce7709d53f00d1d341d2478c96e (patch)
tree2f4b473a0acc813ae773d22ce886dac4e065b20e /fs/bcachefs/ec.h
parent81c771b26639112603bb558bf66441ed3d229eed (diff)
downloadlinux-2a912a9a39bf0ce7709d53f00d1d341d2478c96e.tar.gz
linux-2a912a9a39bf0ce7709d53f00d1d341d2478c96e.tar.bz2
linux-2a912a9a39bf0ce7709d53f00d1d341d2478c96e.zip
bcachefs: Kill bch2_ec_bucket_written()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/ec.h')
-rw-r--r--fs/bcachefs/ec.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/bcachefs/ec.h b/fs/bcachefs/ec.h
index 56d1b5e7d797..d112aea9ec56 100644
--- a/fs/bcachefs/ec.h
+++ b/fs/bcachefs/ec.h
@@ -198,7 +198,6 @@ int bch2_ec_read_extent(struct bch_fs *, struct bch_read_bio *);
void *bch2_writepoint_ec_buf(struct bch_fs *, struct write_point *);
-void bch2_ec_bucket_written(struct bch_fs *, struct open_bucket *);
void bch2_ec_bucket_cancel(struct bch_fs *, struct open_bucket *);
int bch2_ec_stripe_new_alloc(struct bch_fs *, struct ec_stripe_head *);
@@ -213,6 +212,21 @@ void bch2_stripes_heap_del(struct bch_fs *, struct stripe *, size_t);
void bch2_stripes_heap_insert(struct bch_fs *, struct stripe *, size_t);
void bch2_do_stripe_deletes(struct bch_fs *);
+void bch2_ec_do_stripe_creates(struct bch_fs *);
+
+static inline void ec_stripe_new_get(struct ec_stripe_new *s)
+{
+ atomic_inc(&s->pin);
+}
+
+static inline void ec_stripe_new_put(struct bch_fs *c, struct ec_stripe_new *s)
+{
+ BUG_ON(atomic_read(&s->pin) <= 0);
+ BUG_ON(!s->err && !s->idx);
+
+ if (atomic_dec_and_test(&s->pin))
+ bch2_ec_do_stripe_creates(c);
+}
void bch2_ec_stop_dev(struct bch_fs *, struct bch_dev *);