aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_lookup.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-12-03 12:15:39 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-12-03 12:15:39 +0000
commit082d21222b6b6b204f5b20744a2f18c4f08b7e17 (patch)
treec0f126667d6e9d360e21174e1abb90838d0bc036 /sys/kern/vfs_lookup.c
parentf76fedd20b3789acf3b671b180bc119b6f6ee7d7 (diff)
downloadsrc-082d21222b6b6b204f5b20744a2f18c4f08b7e17.tar.gz
src-082d21222b6b6b204f5b20744a2f18c4f08b7e17.zip
Make NAMEI_DIAGNOSTIC compile again and add a stragic vprint()
Notes
Notes: svn path=/head/; revision=138345
Diffstat (limited to 'sys/kern/vfs_lookup.c')
-rw-r--r--sys/kern/vfs_lookup.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 14107543f522..acfe11fe2ae8 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$");
#include <vm/uma.h>
+#define NAMEI_DIAGNOSTIC 1
+#undef NAMEI_DIAGNOSTIC
+
/*
* Allocation zone for namei
*/
@@ -484,6 +487,9 @@ unionlookup:
ndp->ni_vp = NULL;
cnp->cn_flags &= ~PDIRUNLOCK;
ASSERT_VOP_LOCKED(dp, "lookup");
+#ifdef NAMEI_DIAGNOSTIC
+ vprint("lookup in", dp);
+#endif
if ((error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp)) != 0) {
KASSERT(ndp->ni_vp == NULL, ("leaf should be empty"));
#ifdef NAMEI_DIAGNOSTIC
@@ -659,10 +665,6 @@ relookup(dvp, vpp, cnp)
int wantparent; /* 1 => wantparent or lockparent flag */
int rdonly; /* lookup read-only flag bit */
int error = 0;
-#ifdef NAMEI_DIAGNOSTIC
- int newhash; /* DEBUG: check name hash */
- char *cp; /* DEBUG: check name ptr/len */
-#endif
/*
* Setup: break out flag bits into variables.
@@ -687,10 +689,6 @@ relookup(dvp, vpp, cnp)
* responsibility for freeing the pathname buffer.
*/
#ifdef NAMEI_DIAGNOSTIC
- if (cnp->cn_namelen != cp - cnp->cn_nameptr)
- panic ("relookup: bad len");
- if (*cp != 0)
- panic("relookup: not last component");
printf("{%s}: ", cnp->cn_nameptr);
#endif
@@ -723,6 +721,9 @@ relookup(dvp, vpp, cnp)
/*
* We now have a segment name to search for, and a directory to search.
*/
+#ifdef NAMEI_DIAGNOSTIC
+ vprint("search in:", dp);
+#endif
if ((error = VOP_LOOKUP(dp, vpp, cnp)) != 0) {
KASSERT(*vpp == NULL, ("leaf should be empty"));
if (error != EJUSTRETURN)