Commit 4c1c1e39 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: fix bch2_trans_unlock()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a2b6b072
......@@ -1705,7 +1705,7 @@ void bch2_trans_preload_iters(struct btree_trans *trans)
static int btree_trans_iter_alloc(struct btree_trans *trans)
{
unsigned idx = ffz(trans->iters_linked);
unsigned idx = __ffs64(~trans->iters_linked);
if (idx < trans->nr_iters)
goto got_slot;
......@@ -1871,17 +1871,17 @@ void *bch2_trans_kmalloc(struct btree_trans *trans,
int bch2_trans_unlock(struct btree_trans *trans)
{
unsigned iters = trans->iters_linked;
u64 iters = trans->iters_linked;
int ret = 0;
while (iters) {
unsigned idx = __ffs(iters);
unsigned idx = __ffs64(iters);
struct btree_iter *iter = &trans->iters[idx];
ret = ret ?: btree_iter_err(iter);
__bch2_btree_iter_unlock(iter);
iters ^= 1 << idx;
iters ^= 1ULL << idx;
}
return ret;
......
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