diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-17 03:05:30 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:42 -0500 |
commit | c8ef2dc2fc87369a949c3e379ebfe50fe540fa36 (patch) | |
tree | a4fb56b45e8ee005a740219bcf0ad36feaca4bdf /fs/bcachefs | |
parent | 79904fa2bb540e2ecfaa181d7fef8cb21653b0c0 (diff) | |
download | linux-stable-c8ef2dc2fc87369a949c3e379ebfe50fe540fa36.tar.gz linux-stable-c8ef2dc2fc87369a949c3e379ebfe50fe540fa36.tar.bz2 linux-stable-c8ef2dc2fc87369a949c3e379ebfe50fe540fa36.zip |
bcachefs: bch2_dirent_lookup() -> lockrestart_do()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/dirent.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 78ce9634d05c..51fe04f45690 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -471,17 +471,11 @@ u64 bch2_dirent_lookup(struct bch_fs *c, subvol_inum dir, const struct qstr *name, subvol_inum *inum) { struct btree_trans *trans = bch2_trans_get(c); - struct btree_iter iter; - int ret; -retry: - bch2_trans_begin(trans); + struct btree_iter iter = { NULL }; - ret = __bch2_dirent_lookup_trans(trans, &iter, dir, hash_info, - name, inum, 0); - if (bch2_err_matches(ret, BCH_ERR_transaction_restart)) - goto retry; - if (!ret) - bch2_trans_iter_exit(trans, &iter); + int ret = lockrestart_do(trans, + __bch2_dirent_lookup_trans(trans, &iter, dir, hash_info, name, inum, 0)); + bch2_trans_iter_exit(trans, &iter); bch2_trans_put(trans); return ret; } |