git: 43999a5cba3c - main - pseudofs: use vget_prep + vget_finish instead of vget + the interlock

Mateusz Guzik mjg at FreeBSD.org
Wed May 19 17:59:27 UTC 2021


The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=43999a5cba3cfbf0a0f6244c76a3cd548b6925e8

commit 43999a5cba3cfbf0a0f6244c76a3cd548b6925e8
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-19 17:58:42 +0000

    pseudofs: use vget_prep + vget_finish instead of vget + the interlock
---
 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-main mailing list