svn commit: r367947 - head/sys/kern

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Nov 23 12:47:24 UTC 2020


Author: trasz
Date: Mon Nov 23 12:47:23 2020
New Revision: 367947
URL: https://svnweb.freebsd.org/changeset/base/367947

Log:
  Remove the 'wantparent' variable, unused since r145004.
  
  Reviewed by:	kib
  MFC after:	2 weeks
  Sponsored by:	NetApp, Inc.
  Sponsored by:	Klara, Inc.
  Differential Revision:	https://reviews.freebsd.org/D27193

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Mon Nov 23 10:13:56 2020	(r367946)
+++ head/sys/kern/vfs_lookup.c	Mon Nov 23 12:47:23 2020	(r367947)
@@ -1305,7 +1305,6 @@ int
 relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
 {
 	struct vnode *dp = NULL;		/* the directory we are searching */
-	int wantparent;			/* 1 => wantparent or lockparent flag */
 	int rdonly;			/* lookup read-only flag bit */
 	int error = 0;
 
@@ -1314,8 +1313,8 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct
 	/*
 	 * Setup: break out flag bits into variables.
 	 */
-	wantparent = cnp->cn_flags & (LOCKPARENT|WANTPARENT);
-	KASSERT(wantparent, ("relookup: parent not wanted."));
+	KASSERT((cnp->cn_flags & (LOCKPARENT | WANTPARENT)) != 0,
+	    ("relookup: parent not wanted"));
 	rdonly = cnp->cn_flags & RDONLY;
 	cnp->cn_flags &= ~ISSYMLINK;
 	dp = dvp;
@@ -1406,13 +1405,8 @@ relookup(struct vnode *dvp, struct vnode **vpp, struct
 	/*
 	 * Set the parent lock/ref state to the requested state.
 	 */
-	if ((cnp->cn_flags & LOCKPARENT) == 0 && dvp != dp) {
-		if (wantparent)
-			VOP_UNLOCK(dvp);
-		else
-			vput(dvp);
-	} else if (!wantparent)
-		vrele(dvp);
+	if ((cnp->cn_flags & LOCKPARENT) == 0 && dvp != dp)
+		VOP_UNLOCK(dvp);
 	/*
 	 * Check for symbolic link
 	 */


More information about the svn-src-head mailing list