Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern revert vfs_lookup.c rev.1.126 for now because some ...
details: https://anonhg.NetBSD.org/src/rev/fd22cacf9107
branches: trunk
changeset: 759903:fd22cacf9107
user: yamt <yamt%NetBSD.org@localhost>
date: Mon Dec 20 00:12:46 2010 +0000
description:
revert vfs_lookup.c rev.1.126 for now because some problems are reported
on source-changes-d@ (thanks pooka) and i don't think i can take a look at
them in a timely manner.
diffstat:
sys/kern/vfs_lookup.c | 45 ++++++++++-----------------------------------
1 files changed, 10 insertions(+), 35 deletions(-)
diffs (123 lines):
diff -r e4c49e3260bd -r fd22cacf9107 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c Sun Dec 19 23:23:35 2010 +0000
+++ b/sys/kern/vfs_lookup.c Mon Dec 20 00:12:46 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_lookup.c,v 1.126 2010/12/17 22:34:04 yamt Exp $ */
+/* $NetBSD: vfs_lookup.c,v 1.127 2010/12/20 00:12:46 yamt Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.126 2010/12/17 22:34:04 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.127 2010/12/20 00:12:46 yamt Exp $");
#include "opt_magiclinks.h"
@@ -696,7 +696,6 @@
}
return error;
}
- KASSERT(VOP_ISLOCKED(state->namei_startdir) == LK_EXCLUSIVE);
/* Loop through symbolic links */
for (;;) {
@@ -905,11 +904,6 @@
return 0;
}
-/*
- * lookup_parsepath: consume a component name from state->ndp and prepare
- * state->cnp for it.
- */
-
static int
lookup_parsepath(struct namei_state *state)
{
@@ -928,12 +922,16 @@
* cnp->cn_nameptr for callers that need the name. Callers needing
* the name set the SAVENAME flag. When done, they assume
* responsibility for freeing the pathname buffer.
+ *
+ * At this point, our only vnode state is that "dp" is held and locked.
*/
cnp->cn_consume = 0;
cp = NULL;
cnp->cn_hash = namei_hash(cnp->cn_nameptr, &cp);
cnp->cn_namelen = cp - cnp->cn_nameptr;
if (cnp->cn_namelen > NAME_MAX) {
+ vput(state->dp);
+ ndp->ni_dvp = NULL;
return ENAMETOOLONG;
}
#ifdef NAMEI_DIAGNOSTIC
@@ -984,21 +982,6 @@
return 0;
}
-/*
- * lookup_once: look up the vnode for the next component name (state->cnp).
- *
- * takes care of dot-dot, cross-mount, and MNT_UNION.
- *
- * inputs:
- * state->dp the parent vnode
- * state->cnp the componentname to lookup
- *
- * outputs:
- * state->dp the result vnode
- * ndp->ni_vp updated to state->dp
- * ndp->ni_dvp updated to the parent directory vnode
- */
-
static int
lookup_once(struct namei_state *state)
{
@@ -1153,8 +1136,6 @@
* "state->dp" and "ndp->ni_dvp" are both locked and held,
* and may be the same vnode.
*/
- KASSERT(VOP_ISLOCKED(state->dp) == LK_EXCLUSIVE);
- KASSERT(VOP_ISLOCKED(ndp->ni_dvp) == LK_EXCLUSIVE);
/*
* Check to see if the vnode has been mounted on;
@@ -1176,9 +1157,10 @@
vn_lock(ndp->ni_dvp, LK_EXCLUSIVE | LK_RETRY);
return error;
}
- vrele(ndp->ni_dvp);
- vref(tdp);
- ndp->ni_dvp = ndp->ni_vp = state->dp = tdp;
+ VOP_UNLOCK(tdp);
+ ndp->ni_vp = state->dp = tdp;
+ vn_lock(ndp->ni_dvp, LK_EXCLUSIVE | LK_RETRY);
+ vn_lock(ndp->ni_vp, LK_EXCLUSIVE | LK_RETRY);
}
return 0;
@@ -1205,14 +1187,8 @@
}
dirloop:
- /*
- * At this point, our only vnode state is that "dp" is held and locked.
- */
- KASSERT(VOP_ISLOCKED(state->dp) == LK_EXCLUSIVE);
- KASSERT(ndp->ni_dvp == NULL);
error = lookup_parsepath(state);
if (error) {
- vput(state->dp);
goto bad;
}
@@ -1259,7 +1235,6 @@
} else {
vput(ndp->ni_dvp);
}
- ndp->ni_dvp = NULL;
goto dirloop;
}
Home |
Main Index |
Thread Index |
Old Index