mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
bcachefs: fix bch2_trans_unlock()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
a2b6b0729e
commit
4c1c1e3953
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue