Module Name: src
Committed By: dholland
Date: Mon Apr 11 02:20:15 UTC 2011
Modified Files:
src/sys/kern: vfs_lookup.c
Log Message:
description:
Remove dead assignment of "error" and simplify some uses of it.
To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 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.170 src/sys/kern/vfs_lookup.c:1.171
--- src/sys/kern/vfs_lookup.c:1.170 Mon Apr 11 02:20:00 2011
+++ src/sys/kern/vfs_lookup.c Mon Apr 11 02:20:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_lookup.c,v 1.170 2011/04/11 02:20:00 dholland Exp $ */
+/* $NetBSD: vfs_lookup.c,v 1.171 2011/04/11 02:20:15 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.170 2011/04/11 02:20:00 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.171 2011/04/11 02:20:15 dholland Exp $");
#include "opt_magiclinks.h"
@@ -1219,7 +1219,6 @@
}
terminal:
- error = 0;
if (foundobj == ndp->ni_erootdir) {
/*
* We are about to return the emulation root.
@@ -1261,16 +1260,14 @@
switch (cnp->cn_nameiop) {
case CREATE:
- error = EEXIST;
- break;
+ return EEXIST;
case DELETE:
case RENAME:
- error = EBUSY;
- break;
+ return EBUSY;
default:
- KASSERT(0);
+ break;
}
- return (error);
+ panic("Invalid nameiop\n");
}
/*
@@ -1279,7 +1276,6 @@
*/
if (state->rdonly &&
(cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
- error = EROFS;
if (searchdir) {
if (foundobj != searchdir) {
vput(searchdir);
@@ -1293,7 +1289,7 @@
ndp->ni_dvp = NULL;
ndp->ni_vp = NULL;
state->attempt_retry = 1;
- return (error);
+ return EROFS;
}
if ((cnp->cn_flags & LOCKLEAF) == 0) {
VOP_UNLOCK(foundobj);