git: af68d00a202f - stable/13 - pseudofs: use vget_prep + vget_finish instead of vget + the interlock
Mateusz Guzik
mjg at FreeBSD.org
Sat May 22 18:24:03 UTC 2021
The branch stable/13 has been updated by mjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=af68d00a202f74011d165182c85cfecb63eaa3e5
commit af68d00a202f74011d165182c85cfecb63eaa3e5
Author: Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-05-19 14:20:23 +0000
Commit: Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2021-05-22 18:22:35 +0000
pseudofs: use vget_prep + vget_finish instead of vget + the interlock
(cherry picked from commit 43999a5cba3cfbf0a0f6244c76a3cd548b6925e8)
---
sys/fs/pseudofs/pseudofs_vncache.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c
index 8d6f56f6fe27..b0b10d525783 100644
--- a/sys/fs/pseudofs/pseudofs_vncache.c
+++ b/sys/fs/pseudofs/pseudofs_vncache.c
@@ -120,6 +120,7 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp,
struct pfs_vncache_head *hash;
struct pfs_vdata *pvd, *pvd2;
struct vnode *vp;
+ enum vgetstate vs;
int error;
/*
@@ -134,9 +135,9 @@ retry:
if (pvd->pvd_pn == pn && pvd->pvd_pid == pid &&
pvd->pvd_vnode->v_mount == mp) {
vp = pvd->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;
*vpp = vp;
/*
More information about the dev-commits-src-branches
mailing list