diff options
Diffstat (limited to 'fs/bcachefs/btree_update.c')
-rw-r--r-- | fs/bcachefs/btree_update.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/bcachefs/btree_update.c b/fs/bcachefs/btree_update.c index ce3f0af5b1a0..7ee4d18af2d5 100644 --- a/fs/bcachefs/btree_update.c +++ b/fs/bcachefs/btree_update.c @@ -344,16 +344,18 @@ static noinline int flush_new_cached_update(struct btree_trans *trans, enum btree_update_flags flags, unsigned long ip) { - struct btree_path *btree_path; struct bkey k; int ret; - btree_path = bch2_path_get(trans, path->btree_id, path->pos, 1, 0, - BTREE_ITER_INTENT, _THIS_IP_); - ret = bch2_btree_path_traverse(trans, btree_path, 0); + btree_path_idx_t path_idx = + bch2_path_get(trans, path->btree_id, path->pos, 1, 0, + BTREE_ITER_INTENT, _THIS_IP_); + ret = bch2_btree_path_traverse(trans, trans->paths + path_idx, 0); if (ret) goto out; + struct btree_path *btree_path = trans->paths + path_idx; + /* * The old key in the insert entry might actually refer to an existing * key in the btree that has been deleted from cache and not yet @@ -467,7 +469,7 @@ static noinline int bch2_trans_update_get_key_cache(struct btree_trans *trans, int ret; if (!iter->key_cache_path) - iter->key_cache_path = + iter->key_cache_path = trans->paths + bch2_path_get(trans, path->btree_id, path->pos, 1, 0, BTREE_ITER_INTENT| BTREE_ITER_CACHED, _THIS_IP_); |