Module Name:    src
Committed By:   dholland
Date:           Mon Apr 11 02:15:22 UTC 2011

Modified Files:
        src/sys/kern: vfs_lookup.c

Log Message:
description:
Don't bother conditionally doing vput(ndp->ni_dvp) where it's always null.
(and don't bother testing for null where it never is)


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/kern/vfs_lookup.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.154 src/sys/kern/vfs_lookup.c:1.155
--- src/sys/kern/vfs_lookup.c:1.154	Mon Apr 11 02:15:09 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 11 02:15:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.154 2011/04/11 02:15:09 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.155 2011/04/11 02:15:21 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.154 2011/04/11 02:15:09 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.155 2011/04/11 02:15:21 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -1094,9 +1094,7 @@
 			if (searchdir->v_type != VDIR) {
 				vput(searchdir);
 				ndp->ni_vp = NULL;
-				if (ndp->ni_dvp) {
-					vput(ndp->ni_dvp);
-				}
+				KASSERT(ndp->ni_dvp == NULL);
 				state->attempt_retry = 1;
 				return ENOTDIR;
 			}
@@ -1120,9 +1118,6 @@
 			vput(searchdir);
 			ndp->ni_dvp = NULL;
 			ndp->ni_vp = NULL;
-			if (ndp->ni_dvp) {
-				vput(ndp->ni_dvp);
-			}
 			state->attempt_retry = 1;
 			return (error);
 		}
@@ -1131,9 +1126,7 @@
 		ndp->ni_dvp = searchdir;
 		if (error) {
 			ndp->ni_vp = NULL;
-			if (ndp->ni_dvp) {
-				vput(ndp->ni_dvp);
-			}
+			vput(ndp->ni_dvp);
 			/*
 			 * Note that if we're doing TRYEMULROOT we can
 			 * retry with the normal root. Where this is

Reply via email to