Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 2021 17:59:27 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 43999a5cba3c - main - pseudofs: use vget_prep + vget_finish instead of vget + the interlock
Message-ID:  <202105191759.14JHxR3J021634@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg:

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

commit 43999a5cba3cfbf0a0f6244c76a3cd548b6925e8
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-05-19 14:20:23 +0000
Commit:     Mateusz Guzik <mjg@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;
 				/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105191759.14JHxR3J021634>