mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
bcachefs: Improve bch2_trans_relock()
We're getting away from relying on iter->uptodate - this changes bch2_trans_relock() to more directly specify which iterators should be relocked. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
acb3b26e76
commit
d5a43661a1
@ -504,13 +504,12 @@ void bch2_trans_downgrade(struct btree_trans *trans)
|
||||
bool bch2_trans_relock(struct btree_trans *trans)
|
||||
{
|
||||
struct btree_iter *iter;
|
||||
bool ret = true;
|
||||
|
||||
trans_for_each_iter(trans, iter)
|
||||
if (iter->uptodate == BTREE_ITER_NEED_RELOCK)
|
||||
ret &= bch2_btree_iter_relock(iter, true);
|
||||
|
||||
return ret;
|
||||
if (btree_iter_keep(trans, iter) &&
|
||||
!bch2_btree_iter_relock(iter, true))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void bch2_trans_unlock(struct btree_trans *trans)
|
||||
|
Loading…
Reference in New Issue
Block a user