Commit d5a43661 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent acb3b26e
...@@ -504,13 +504,12 @@ void bch2_trans_downgrade(struct btree_trans *trans) ...@@ -504,13 +504,12 @@ void bch2_trans_downgrade(struct btree_trans *trans)
bool bch2_trans_relock(struct btree_trans *trans) bool bch2_trans_relock(struct btree_trans *trans)
{ {
struct btree_iter *iter; struct btree_iter *iter;
bool ret = true;
trans_for_each_iter(trans, iter) trans_for_each_iter(trans, iter)
if (iter->uptodate == BTREE_ITER_NEED_RELOCK) if (btree_iter_keep(trans, iter) &&
ret &= bch2_btree_iter_relock(iter, true); !bch2_btree_iter_relock(iter, true))
return false;
return ret; return true;
} }
void bch2_trans_unlock(struct btree_trans *trans) void bch2_trans_unlock(struct btree_trans *trans)
......
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