vfs: retire NAMEI_DIAGNOSTIC

It is too spammy and information-deficient for practical use.

Also see https://reviews.freebsd.org/D41207
This commit is contained in:
Mateusz Guzik
2023-08-09 10:37:13 +00:00
parent 393387820b
commit b8b33f3b3b
+1 -27
View File
@@ -71,9 +71,6 @@ __FBSDID("$FreeBSD$");
#include <vm/uma.h>
#define NAMEI_DIAGNOSTIC 1
#undef NAMEI_DIAGNOSTIC
#ifdef INVARIANTS
static void NDVALIDATE_impl(struct nameidata *, int);
#define NDVALIDATE(ndp) NDVALIDATE_impl(ndp, __LINE__)
@@ -1106,12 +1103,6 @@ vfs_lookup(struct nameidata *ndp)
error = ENAMETOOLONG;
goto bad;
}
#ifdef NAMEI_DIAGNOSTIC
{ char c = *cp;
*cp = '\0';
printf("{%s}: ", cnp->cn_nameptr);
*cp = c; }
#endif
prev_ni_pathlen = ndp->ni_pathlen;
ndp->ni_pathlen -= cnp->cn_namelen;
KASSERT(ndp->ni_pathlen <= PATH_MAX,
@@ -1258,18 +1249,12 @@ vfs_lookup(struct nameidata *ndp)
*/
if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags))
cnp->cn_lkflags = LK_EXCLUSIVE;
#ifdef NAMEI_DIAGNOSTIC
vn_printf(dp, "lookup in ");
#endif
lkflags_save = cnp->cn_lkflags;
cnp->cn_lkflags = enforce_lkflags(dp->v_mount, cnp->cn_lkflags);
error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp);
cnp->cn_lkflags = lkflags_save;
if (error != 0) {
KASSERT(ndp->ni_vp == NULL, ("leaf should be empty"));
#ifdef NAMEI_DIAGNOSTIC
printf("not found\n");
#endif
if ((error == ENOENT) &&
(dp->v_vflag & VV_ROOT) && (dp->v_mount != NULL) &&
(dp->v_mount->mnt_flag & MNT_UNION)) {
@@ -1321,9 +1306,6 @@ vfs_lookup(struct nameidata *ndp)
}
good:
#ifdef NAMEI_DIAGNOSTIC
printf("found\n");
#endif
dp = ndp->ni_vp;
/*
@@ -1509,12 +1491,7 @@ vfs_relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
* Search a new directory.
*
* See a comment in vfs_lookup for cnp->cn_nameptr.
*/
#ifdef NAMEI_DIAGNOSTIC
printf("{%s}: ", cnp->cn_nameptr);
#endif
/*
*
* Check for "" which represents the root directory after slash
* removal.
*/
@@ -1541,9 +1518,6 @@ vfs_relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
/*
* We now have a segment name to search for, and a directory to search.
*/
#ifdef NAMEI_DIAGNOSTIC
vn_printf(dp, "search in ");
#endif
if ((error = VOP_LOOKUP(dp, vpp, cnp)) != 0) {
KASSERT(*vpp == NULL, ("leaf should be empty"));
if (error != EJUSTRETURN)