]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/alloc_foreground.c
rust: Fix ptr casting in Fs::open()
[bcachefs-tools-debian] / libbcachefs / alloc_foreground.c
index af1c1e2b5e97e75c74e5c3a6500139a81e4f4e00..b2755c1e688955a4a326b78ed80394a043ba2d82 100644 (file)
@@ -754,6 +754,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)
 {
@@ -771,9 +772,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)
@@ -958,7 +957,8 @@ static int __open_bucket_add_buckets(struct btree_trans *trans,
                ret = bucket_alloc_from_stripe(trans, ptrs, wp, &devs,
                                         target,
                                         nr_replicas, nr_effective,
-                                        have_cache, flags, _cl);
+                                        have_cache,
+                                        reserve, flags, _cl);
        } else {
 retry_blocking:
                /*