Commit c8ef2dc2 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_dirent_lookup() -> lockrestart_do()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 79904fa2
...@@ -471,17 +471,11 @@ u64 bch2_dirent_lookup(struct bch_fs *c, subvol_inum dir, ...@@ -471,17 +471,11 @@ u64 bch2_dirent_lookup(struct bch_fs *c, subvol_inum dir,
const struct qstr *name, subvol_inum *inum) const struct qstr *name, subvol_inum *inum)
{ {
struct btree_trans *trans = bch2_trans_get(c); struct btree_trans *trans = bch2_trans_get(c);
struct btree_iter iter; struct btree_iter iter = { NULL };
int ret;
retry:
bch2_trans_begin(trans);
ret = __bch2_dirent_lookup_trans(trans, &iter, dir, hash_info, int ret = lockrestart_do(trans,
name, inum, 0); __bch2_dirent_lookup_trans(trans, &iter, dir, hash_info, name, inum, 0));
if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) bch2_trans_iter_exit(trans, &iter);
goto retry;
if (!ret)
bch2_trans_iter_exit(trans, &iter);
bch2_trans_put(trans); bch2_trans_put(trans);
return ret; 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