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/a2f4b1492782
branches:  trunk
changeset: 764063:a2f4b1492782
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Apr 11 02:12:42 2011 +0000

description:
description:
lookup_once() on success always sets ni_vp to the same thing as the
returned foundobj, so do that in the caller instead.

diffstat:

 sys/kern/vfs_lookup.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r e62edd543761 -r a2f4b1492782 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Mon Apr 11 02:11:32 2011 +0000
+++ b/sys/kern/vfs_lookup.c     Mon Apr 11 02:12:42 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lookup.c,v 1.148 2011/04/11 02:11:32 dholland Exp $        */
+/*     $NetBSD: vfs_lookup.c,v 1.149 2011/04/11 02:12:42 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.148 2011/04/11 02:11:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.149 2011/04/11 02:12:42 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -892,7 +892,6 @@
                                foundobj = searchdir;
                                vref(foundobj);
                                ndp->ni_dvp = searchdir;
-                               ndp->ni_vp = foundobj;
                                *foundobj_ret = foundobj;
                                return 0;
                        }
@@ -916,7 +915,6 @@
                                    vref(foundobj);
                                    vref(foundobj);
                                    ndp->ni_dvp = foundobj;
-                                   ndp->ni_vp = foundobj;
                                    vn_lock(foundobj, LK_EXCLUSIVE | LK_RETRY);
                                    *foundobj_ret = foundobj;
                                    return 0;
@@ -986,7 +984,6 @@
                 */
                state->lookup_alldone = 1;
                ndp->ni_dvp = searchdir;
-               ndp->ni_vp = NULL;
                *foundobj_ret = NULL;
                return (0);
        }
@@ -1039,7 +1036,6 @@
        }
 
        ndp->ni_dvp = searchdir;
-       ndp->ni_vp = foundobj;
        *foundobj_ret = foundobj;
        return 0;
 }
@@ -1166,6 +1162,7 @@
                        state->attempt_retry = 1;
                        return (error);
                }
+               ndp->ni_vp = foundobj;
                // XXX ought to be able to avoid this case too
                if (state->lookup_alldone) {
                        error = 0;
@@ -1459,6 +1456,7 @@
        if (error) {
                goto bad;
        }
+       ndp->ni_vp = foundobj;
        // XXX ought to be able to avoid this case too
        if (state->lookup_alldone) {
                /* this should NOT be "goto terminal;" */



Home | Main Index | Thread Index | Old Index