summaryrefslogtreecommitdiff
path: root/fs/bcachefs/data_update.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-01 03:59:45 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 17:29:24 -0400
commitd8585a79bebcfb3315f23c955e36ab8d8a7749d5 (patch)
tree5a3f21fd6f60e7144865ffe07bfb0ad23e97ad83 /fs/bcachefs/data_update.c
parent222eacabc17f360ede4efddda50534f828228ed0 (diff)
bcachefs: bch2_dev_have_ref()
bch2_dev_bkey_exists() is going away; bch2_dev_have_ref() documents that we're looking up a device without checking if it's present because we have a reference to it already. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r--fs/bcachefs/data_update.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c
index 1dee93eee7ad..0d807c2ce9c6 100644
--- a/fs/bcachefs/data_update.c
+++ b/fs/bcachefs/data_update.c
@@ -360,7 +360,7 @@ void bch2_data_update_exit(struct data_update *update)
bch2_bkey_ptrs_c(bkey_i_to_s_c(update->k.k));
bkey_for_each_ptr(ptrs, ptr) {
- struct bch_dev *ca = bch2_dev_bkey_exists(c, ptr->dev);
+ struct bch_dev *ca = bch2_dev_have_ref(c, ptr->dev);
if (c->opts.nocow_enabled)
bch2_bucket_nocow_unlock(&c->nocow_locks,
PTR_BUCKET_POS(ca, ptr), 0);
@@ -559,7 +559,7 @@ int bch2_data_update_init(struct btree_trans *trans,
i = 0;
bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
- struct bch_dev *ca = bch2_dev_bkey_exists(c, p.ptr.dev);
+ struct bch_dev *ca = bch2_dev_have_ref(c, p.ptr.dev);
struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr);
bool locked;
@@ -664,7 +664,7 @@ int bch2_data_update_init(struct btree_trans *trans,
err:
i = 0;
bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
- struct bch_dev *ca = bch2_dev_bkey_exists(c, p.ptr.dev);
+ struct bch_dev *ca = bch2_dev_have_ref(c, p.ptr.dev);
struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr);
if ((1U << i) & ptrs_locked)
bch2_bucket_nocow_unlock(&c->nocow_locks, bucket, 0);