pseudofs: use the vget_prep/vget_finish idiom

This commit is contained in:
Mateusz Guzik 2022-09-19 20:07:10 +00:00
parent 4e1262ac99
commit 2c2ef670a7

View File

@ -218,9 +218,9 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp,
if (pvd2->pvd_pn == pn && pvd2->pvd_pid == pid &&
pvd2->pvd_vnode->v_mount == mp) {
vp = pvd2->pvd_vnode;
VI_LOCK(vp);
vs = vget_prep(vp);
mtx_unlock(&pfs_vncache_mutex);
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK) == 0) {
if (vget_finish(vp, LK_EXCLUSIVE, vs) == 0) {
++pfs_vncache_hits;
vgone(*vpp);
vput(*vpp);