mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
bcachefs: bch2_trans_mark_pointer() refactoring
bch2_bucket_backpointer_mod() doesn't need to update the alloc key, we can exit the alloc iter earlier. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
9473cff989
commit
3a63b32f12
@ -1441,20 +1441,20 @@ static inline int bch2_trans_mark_pointer(struct btree_trans *trans,
|
||||
|
||||
ret = __mark_pointer(trans, k, &p.ptr, sectors, bp.data_type,
|
||||
a->v.gen, &a->v.data_type,
|
||||
&a->v.dirty_sectors, &a->v.cached_sectors);
|
||||
&a->v.dirty_sectors, &a->v.cached_sectors) ?:
|
||||
bch2_trans_update(trans, &iter, &a->k_i, 0);
|
||||
bch2_trans_iter_exit(trans, &iter);
|
||||
|
||||
if (ret)
|
||||
goto err;
|
||||
return ret;
|
||||
|
||||
if (!p.ptr.cached) {
|
||||
ret = bch2_bucket_backpointer_mod(trans, bucket, bp, k, insert);
|
||||
if (ret)
|
||||
goto err;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = bch2_trans_update(trans, &iter, &a->k_i, 0);
|
||||
err:
|
||||
bch2_trans_iter_exit(trans, &iter);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bch2_trans_mark_stripe_ptr(struct btree_trans *trans,
|
||||
|
Loading…
Reference in New Issue
Block a user