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/9a16df00429b
branches:  trunk
changeset: 764085:9a16df00429b
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Apr 11 02:20:15 2011 +0000

description:
description:
Remove dead assignment of "error" and simplify some uses of it.

diffstat:

 sys/kern/vfs_lookup.c |  18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diffs (64 lines):

diff -r 1a7cade4c535 -r 9a16df00429b sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Mon Apr 11 02:20:00 2011 +0000
+++ b/sys/kern/vfs_lookup.c     Mon Apr 11 02:20:15 2011 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index