Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2022 00:12:25 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: 4e91a0b9fece - main - nullfs: stop using insmntque1
Message-ID:  <202201270012.20R0CP0P002602@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=4e91a0b9fece53711d5ff8fbc56762bd6d5fee4f

commit 4e91a0b9fece53711d5ff8fbc56762bd6d5fee4f
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-01-26 23:53:59 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-01-26 23:54:47 +0000

    nullfs: stop using insmntque1
    
    It adds nothing of value over insmntque.
---
 sys/fs/nullfs/null_subr.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c
index fb6a13449df7..5f8cbfd4ce31 100644
--- a/sys/fs/nullfs/null_subr.c
+++ b/sys/fs/nullfs/null_subr.c
@@ -182,14 +182,6 @@ null_destroy_proto(struct vnode *vp, void *xp)
 	free(xp, M_NULLFSNODE);
 }
 
-static void
-null_insmntque_dtr(struct vnode *vp, void *xp)
-{
-
-	vput(((struct null_node *)xp)->null_lowervp);
-	null_destroy_proto(vp, xp);
-}
-
 /*
  * Make a new or get existing nullfs node.
  * Vp is the alias vnode, lowervp is the lower vnode.
@@ -219,7 +211,7 @@ null_nodeget(mp, lowervp, vpp)
 	}
 
 	/*
-	 * The insmntque1() call below requires the exclusive lock on
+	 * The insmntque() call below requires the exclusive lock on
 	 * the nullfs vnode.  Upgrade the lock now if hash failed to
 	 * provide ready to use vnode.
 	 */
@@ -252,9 +244,12 @@ null_nodeget(mp, lowervp, vpp)
 	vp->v_type = lowervp->v_type;
 	vp->v_data = xp;
 	vp->v_vnlock = lowervp->v_vnlock;
-	error = insmntque1(vp, mp, null_insmntque_dtr, xp);
-	if (error != 0)
+	error = insmntque(vp, mp);
+	if (error != 0) {
+		vput(lowervp);
+		null_destroy_proto(vp, xp);
 		return (error);
+	}
 	if (lowervp == MOUNTTONULLMOUNT(mp)->nullm_lowerrootvp)
 		vp->v_vflag |= VV_ROOT;
 



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