summaryrefslogtreecommitdiff
path: root/fs/bcachefs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/namei.c')
-rw-r--r--fs/bcachefs/namei.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/fs/bcachefs/namei.c b/fs/bcachefs/namei.c
index cfed2041c2c3..d1019052f182 100644
--- a/fs/bcachefs/namei.c
+++ b/fs/bcachefs/namei.c
@@ -383,9 +383,8 @@ bool bch2_reinherit_attrs(struct bch_inode_unpacked *dst_u,
static int subvol_update_parent(struct btree_trans *trans, u32 subvol, u32 new_parent)
{
- struct btree_iter iter;
struct bkey_i_subvolume *s =
- bch2_bkey_get_mut_typed(trans, &iter,
+ bch2_bkey_get_mut_typed(trans,
BTREE_ID_subvolumes, POS(0, subvol),
BTREE_ITER_cached, subvolume);
int ret = PTR_ERR_OR_ZERO(s);
@@ -393,7 +392,6 @@ static int subvol_update_parent(struct btree_trans *trans, u32 subvol, u32 new_p
return ret;
s->v.fs_path_parent = cpu_to_le32(new_parent);
- bch2_trans_iter_exit(&iter);
return 0;
}
@@ -687,10 +685,9 @@ static int __bch2_inum_to_path(struct btree_trans *trans,
goto disconnected;
}
- struct btree_iter d_iter;
- struct bkey_s_c_dirent d = bch2_bkey_get_iter_typed(trans, &d_iter,
- BTREE_ID_dirents, SPOS(inode.bi_dir, inode.bi_dir_offset, snapshot),
- 0, dirent);
+ CLASS(btree_iter, d_iter)(trans, BTREE_ID_dirents,
+ SPOS(inode.bi_dir, inode.bi_dir_offset, snapshot), 0);
+ struct bkey_s_c_dirent d = bch2_bkey_get_typed(&d_iter, dirent);
ret = bkey_err(d.s_c);
if (ret)
goto disconnected;
@@ -700,8 +697,6 @@ static int __bch2_inum_to_path(struct btree_trans *trans,
prt_bytes_reversed(path, dirent_name.name, dirent_name.len);
prt_char(path, '/');
-
- bch2_trans_iter_exit(&d_iter);
}
if (orig_pos == path->pos)
@@ -779,10 +774,9 @@ static int bch2_check_dirent_inode_dirent(struct btree_trans *trans,
return __bch2_fsck_write_inode(trans, target);
}
- struct bkey_s_c_dirent bp_dirent =
- bch2_bkey_get_iter_typed(trans, &bp_iter, BTREE_ID_dirents,
- SPOS(target->bi_dir, target->bi_dir_offset, target->bi_snapshot),
- 0, dirent);
+ bch2_trans_iter_init(trans, &bp_iter, BTREE_ID_dirents,
+ SPOS(target->bi_dir, target->bi_dir_offset, target->bi_snapshot), 0);
+ struct bkey_s_c_dirent bp_dirent = bch2_bkey_get_typed(&bp_iter, dirent);
ret = bkey_err(bp_dirent);
if (ret && !bch2_err_matches(ret, ENOENT))
goto err;