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/22e90509d761
branches: trunk
changeset: 764075:22e90509d761
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Apr 11 02:17:14 2011 +0000
description:
description:
Pass foundobj to namei_follow() instead of fishing in the global state.
diffstat:
sys/kern/vfs_lookup.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (65 lines):
diff -r 65639f6dfe32 -r 22e90509d761 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c Mon Apr 11 02:17:01 2011 +0000
+++ b/sys/kern/vfs_lookup.c Mon Apr 11 02:17:14 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_lookup.c,v 1.160 2011/04/11 02:17:01 dholland Exp $ */
+/* $NetBSD: vfs_lookup.c,v 1.161 2011/04/11 02:17:14 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.160 2011/04/11 02:17:01 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.161 2011/04/11 02:17:14 dholland Exp $");
#include "opt_magiclinks.h"
@@ -633,7 +633,7 @@
*/
static inline int
namei_follow(struct namei_state *state, int inhibitmagic,
- struct vnode *searchdir,
+ struct vnode *searchdir, struct vnode *foundobj,
struct vnode **newsearchdir_ret)
{
struct nameidata *ndp = state->ndp;
@@ -649,8 +649,8 @@
if (ndp->ni_loopcnt++ >= MAXSYMLINKS) {
return ELOOP;
}
- if (ndp->ni_vp->v_mount->mnt_flag & MNT_SYMPERM) {
- error = VOP_ACCESS(ndp->ni_vp, VEXEC, cnp->cn_cred);
+ if (foundobj->v_mount->mnt_flag & MNT_SYMPERM) {
+ error = VOP_ACCESS(foundobj, VEXEC, cnp->cn_cred);
if (error != 0)
return error;
}
@@ -665,7 +665,7 @@
auio.uio_rw = UIO_READ;
auio.uio_resid = MAXPATHLEN;
UIO_SETUP_SYSSPACE(&auio);
- error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred);
+ error = VOP_READLINK(foundobj, &auio, cnp->cn_cred);
if (error) {
PNBUF_PUT(cp);
return error;
@@ -698,7 +698,7 @@
ndp->ni_pathlen += linklen;
memcpy(ndp->ni_pnbuf, cp, ndp->ni_pathlen);
PNBUF_PUT(cp);
- vput(ndp->ni_vp);
+ vput(foundobj);
/*
* Check if root directory should replace current directory.
@@ -1173,7 +1173,7 @@
* symlink in. (FUTURE)
*/
error = namei_follow(state, inhibitmagic,
- searchdir,
+ searchdir, ndp->ni_vp,
&searchdir);
}
if (error) {
Home |
Main Index |
Thread Index |
Old Index