summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/alloc_foreground.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-03 17:39:16 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 17:29:22 -0400
commitf295298b8c6413f0ed2a5a69dd7f32409cc54f1d (patch)
treea3266d3a851dad863746331a28400a86205331c2 /fs/bcachefs/alloc_foreground.c
parente98786ea855cb28176e27ffce23fb163a36ed32e (diff)
downloadlinux-f295298b8c6413f0ed2a5a69dd7f32409cc54f1d.tar.gz
linux-f295298b8c6413f0ed2a5a69dd7f32409cc54f1d.tar.bz2
linux-f295298b8c6413f0ed2a5a69dd7f32409cc54f1d.zip
bcachefs: New helpers for device refcounts
This will be used in the next patch for adding some new debug mode asserts. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_foreground.c')
-rw-r--r--fs/bcachefs/alloc_foreground.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c
index 13460aab3cae..92cafde165c0 100644
--- a/fs/bcachefs/alloc_foreground.c
+++ b/fs/bcachefs/alloc_foreground.c
@@ -733,21 +733,21 @@ int bch2_bucket_alloc_set_trans(struct btree_trans *trans,
rcu_read_lock();
ca = rcu_dereference(c->devs[dev]);
if (ca)
- percpu_ref_get(&ca->ref);
+ bch2_dev_get(ca);
rcu_read_unlock();
if (!ca)
continue;
if (!ca->mi.durability && *have_cache) {
- percpu_ref_put(&ca->ref);
+ bch2_dev_put(ca);
continue;
}
ob = bch2_bucket_alloc_trans(trans, ca, watermark, data_type, cl, &usage);
if (!IS_ERR(ob))
bch2_dev_stripe_increment_inlined(ca, stripe, &usage);
- percpu_ref_put(&ca->ref);
+ bch2_dev_put(ca);
if (IS_ERR(ob)) {
ret = PTR_ERR(ob);