Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern description:
details: https://anonhg.NetBSD.org/src/rev/1f9f3e405bb1
branches: trunk
changeset: 764069:1f9f3e405bb1
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Apr 11 02:15:21 2011 +0000
description:
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)
diffstat:
sys/kern/vfs_lookup.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
diffs (50 lines):
diff -r cd912f854b6d -r 1f9f3e405bb1 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c Mon Apr 11 02:15:09 2011 +0000
+++ b/sys/kern/vfs_lookup.c Mon Apr 11 02:15:21 2011 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index