1

bcachefs: Use bch2_btree_path_upgrade() in key cache traverse

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-04-10 00:35:24 -04:00
parent 5d8c9d9428
commit 4984faff5d

View File

@ -516,22 +516,9 @@ fill:
path->uptodate = BTREE_ITER_UPTODATE; path->uptodate = BTREE_ITER_UPTODATE;
if (!ck->valid && !(flags & BTREE_ITER_cached_nofill)) { if (!ck->valid && !(flags & BTREE_ITER_cached_nofill)) {
/* ret = bch2_btree_path_upgrade(trans, path, 1) ?:
* Using the underscore version because we haven't set btree_key_cache_fill(trans, path, ck) ?:
* path->uptodate yet: bch2_btree_path_relock(trans, path, _THIS_IP_);
*/
if (!path->locks_want &&
!__bch2_btree_path_upgrade(trans, path, 1, NULL)) {
trace_and_count(trans->c, trans_restart_key_cache_upgrade, trans, _THIS_IP_);
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_key_cache_upgrade);
goto err;
}
ret = btree_key_cache_fill(trans, path, ck);
if (ret)
goto err;
ret = bch2_btree_path_relock(trans, path, _THIS_IP_);
if (ret) if (ret)
goto err; goto err;