Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Improve namei_atsymlink to take the found object as...



details:   https://anonhg.NetBSD.org/src/rev/1e3157a02b39
branches:  trunk
changeset: 764057:1e3157a02b39
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Apr 11 01:39:28 2011 +0000

description:
Improve namei_atsymlink to take the found object as an argument
instead of fetching it from the global state.

diffstat:

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

diffs (39 lines):

diff -r 472734f4641f -r 1e3157a02b39 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Mon Apr 11 01:39:13 2011 +0000
+++ b/sys/kern/vfs_lookup.c     Mon Apr 11 01:39:28 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lookup.c,v 1.143 2011/04/11 01:39:13 dholland Exp $        */
+/*     $NetBSD: vfs_lookup.c,v 1.144 2011/04/11 01:39:28 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.143 2011/04/11 01:39:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.144 2011/04/11 01:39:28 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -640,9 +640,9 @@
  * Check for being at a symlink.
  */
 static inline int
-namei_atsymlink(struct namei_state *state)
+namei_atsymlink(struct namei_state *state, struct vnode *foundobj)
 {
-       return (state->dp->v_type == VLNK) &&
+       return (foundobj->v_type == VLNK) &&
                (state->cnp->cn_flags & (FOLLOW|REQUIREDIR));
 }
 
@@ -1168,7 +1168,7 @@
                 * over any slashes that we skipped, as we will need
                 * them again.
                 */
-               if (namei_atsymlink(state)) {
+               if (namei_atsymlink(state, state->dp)) {
                        ndp->ni_pathlen += state->slashes;
                        ndp->ni_next -= state->slashes;
                        cnp->cn_flags |= ISSYMLINK;



Home | Main Index | Thread Index | Old Index