Commit 222eacab authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: kill bch2_dev_bkey_exists() in data_update_init()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a9422fd4
...@@ -544,8 +544,16 @@ int bch2_data_update_init(struct btree_trans *trans, ...@@ -544,8 +544,16 @@ int bch2_data_update_init(struct btree_trans *trans,
m->op.compression_opt = background_compression(io_opts); m->op.compression_opt = background_compression(io_opts);
m->op.watermark = m->data_opts.btree_insert_flags & BCH_WATERMARK_MASK; m->op.watermark = m->data_opts.btree_insert_flags & BCH_WATERMARK_MASK;
bkey_for_each_ptr(ptrs, ptr) bkey_for_each_ptr(ptrs, ptr) {
bch2_dev_get(bch2_dev_bkey_exists(c, ptr->dev)); if (!bch2_dev_tryget(c, ptr->dev)) {
bkey_for_each_ptr(ptrs, ptr2) {
if (ptr2 == ptr)
break;
bch2_dev_put(bch2_dev_have_ref(c, ptr2->dev));
}
return -BCH_ERR_data_update_done;
}
}
unsigned durability_have = 0, durability_removing = 0; unsigned durability_have = 0, durability_removing = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment