diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-03 02:43:39 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:55 -0400 |
commit | a1fb08f5df6a8b2995d9daf8c2997cd478b51c55 (patch) | |
tree | 6c36435be6d403d82d46c7eb180e25d29ba80c56 /fs/bcachefs/alloc_foreground.c | |
parent | 910659763edaba58aa04bd5924dd933bc08cc56f (diff) | |
download | linux-a1fb08f5df6a8b2995d9daf8c2997cd478b51c55.tar.gz linux-a1fb08f5df6a8b2995d9daf8c2997cd478b51c55.tar.bz2 linux-a1fb08f5df6a8b2995d9daf8c2997cd478b51c55.zip |
bcachefs: Plumb alloc_reserve through stripe create path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r-- | fs/bcachefs/alloc_foreground.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index 161585de70c8..5aab85f1a835 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -794,6 +794,7 @@ static int bucket_alloc_from_stripe(struct btree_trans *trans, unsigned nr_replicas, unsigned *nr_effective, bool *have_cache, + enum alloc_reserve reserve, unsigned flags, struct closure *cl) { @@ -813,9 +814,7 @@ static int bucket_alloc_from_stripe(struct btree_trans *trans, if (ec_open_bucket(c, ptrs)) return 0; - h = bch2_ec_stripe_head_get(trans, target, 0, nr_replicas - 1, - wp == &c->copygc_write_point, - cl); + h = bch2_ec_stripe_head_get(trans, target, 0, nr_replicas - 1, reserve, cl); if (IS_ERR(h)) return PTR_ERR(h); if (!h) @@ -926,7 +925,7 @@ static int open_bucket_add_buckets(struct btree_trans *trans, ret = bucket_alloc_from_stripe(trans, ptrs, wp, &devs, target, erasure_code, nr_replicas, nr_effective, - have_cache, flags, _cl); + have_cache, reserve, flags, _cl); if (bch2_err_matches(ret, BCH_ERR_transaction_restart) || bch2_err_matches(ret, BCH_ERR_freelist_empty) || bch2_err_matches(ret, BCH_ERR_open_buckets_empty)) |