summaryrefslogtreecommitdiff
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-04-02 17:23:22 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-04-06 19:13:45 -0400
commitcf988b7b108cf60b11ff9463f31f3fd303627189 (patch)
tree6b8830b73ad5d6ee765b745ef8c163d179b63290 /fs/bcachefs/alloc_foreground.c
parentd1013e99d93d9d7947064b483cfa86a8b3c54ccd (diff)
bcachefs: reduce new_stripe_alloc_buckets() stack usage
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 858a60245b92..ae7eb523fae7 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -829,15 +829,15 @@ static int bucket_alloc_set_writepoint(struct bch_fs *c,
unsigned i;
int ret = 0;
- req->ptrs2.nr = 0;
+ req->scratch_ptrs.nr = 0;
open_bucket_for_each(c, &req->wp->ptrs, ob, i) {
if (!ret && want_bucket(c, req, ob))
ret = add_new_bucket(c, req, ob);
else
- ob_push(c, &req->ptrs2, ob);
+ ob_push(c, &req->scratch_ptrs, ob);
}
- req->wp->ptrs = req->ptrs2;
+ req->wp->ptrs = req->scratch_ptrs;
return ret;
}
@@ -1214,7 +1214,7 @@ deallocate_extra_replicas(struct bch_fs *c,
unsigned extra_replicas = req->nr_effective - req->nr_replicas;
unsigned i;
- req->ptrs2.nr = 0;
+ req->scratch_ptrs.nr = 0;
open_bucket_for_each(c, &req->ptrs, ob, i) {
unsigned d = ob_dev(c, ob)->mi.durability;
@@ -1223,11 +1223,11 @@ deallocate_extra_replicas(struct bch_fs *c,
extra_replicas -= d;
ob_push(c, &req->wp->ptrs, ob);
} else {
- ob_push(c, &req->ptrs2, ob);
+ ob_push(c, &req->scratch_ptrs, ob);
}
}
- req->ptrs = req->ptrs2;
+ req->ptrs = req->scratch_ptrs;
}
/*