diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-03 23:39:16 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-05-08 23:29:22 +0200 |
commit | f295298b8c6413f0ed2a5a69dd7f32409cc54f1d (patch) | |
tree | a3266d3a851dad863746331a28400a86205331c2 /fs/bcachefs/alloc_foreground.c | |
parent | bcachefs: bch2_print_allocator_stuck() (diff) | |
download | linux-f295298b8c6413f0ed2a5a69dd7f32409cc54f1d.tar.xz 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.c | 6 |
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); |