git: 3150cf0c1346 - main - unionfs: stop using insmntque1

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Thu, 27 Jan 2022 00:12:27 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=3150cf0c134651588cf83f9ea1fc0cd4a0c6ba4d

commit 3150cf0c134651588cf83f9ea1fc0cd4a0c6ba4d
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-01-26 23:57:32 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-01-26 23:57:37 +0000

    unionfs: stop using insmntque1
    
    It adds nothing of value over insmntque.
---
 sys/fs/unionfs/union_subr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index c70e8eae5580..57b6051104de 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -256,9 +256,8 @@ unionfs_rem_cached_vnode(struct unionfs_node *unp, struct vnode *dvp)
  * This function will return with the caller's locks and references undone.
  */
 static void
-unionfs_nodeget_cleanup(struct vnode *vp, void *arg)
+unionfs_nodeget_cleanup(struct vnode *vp, struct unionfs_node *unp)
 {
-	struct unionfs_node *unp;
 
 	/*
 	 * Lock and reset the default vnode lock; vgone() expects a locked
@@ -278,7 +277,6 @@ unionfs_nodeget_cleanup(struct vnode *vp, void *arg)
 	vgone(vp);
 	vput(vp);
 
-	unp = arg;
 	if (unp->un_dvp != NULLVP)
 		vrele(unp->un_dvp);
 	if (unp->un_uppervp != NULLVP)
@@ -388,9 +386,11 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp,
 		vp->v_vflag |= VV_ROOT;
 
 	vn_lock_pair(lowervp, false, uppervp, false); 
-	error = insmntque1(vp, mp, unionfs_nodeget_cleanup, unp);
-	if (error != 0)
+	error = insmntque(vp, mp);
+	if (error != 0) {
+		unionfs_nodeget_cleanup(vp, unp);
 		return (error);
+	}
 	if (lowervp != NULL && VN_IS_DOOMED(lowervp)) {
 		vput(lowervp);
 		unp->un_lowervp = NULL;