From a0f40f54aac1268e2abf151d4042948613cdf1b2 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 4 Sep 1999 12:35:09 +0000 Subject: [PATCH] Get rid of the NULLFS_DIAGNOSTIC option. This option was as useful as the other XXXFS_DIAGNOSTIC options (not very) and mostly controlled tracing of normal operation. Use `#ifdef DEBUG' for non-diagnostics and `#ifdef DIAGNOSTIC' for diagnostics. --- sys/fs/nullfs/null.h | 2 +- sys/fs/nullfs/null_subr.c | 12 +++++------- sys/fs/nullfs/null_vfsops.c | 18 ++++++++---------- sys/fs/nullfs/null_vnops.c | 2 -- sys/miscfs/nullfs/null.h | 2 +- sys/miscfs/nullfs/null_subr.c | 12 +++++------- sys/miscfs/nullfs/null_vfsops.c | 18 ++++++++---------- sys/miscfs/nullfs/null_vnops.c | 2 -- 8 files changed, 28 insertions(+), 40 deletions(-) diff --git a/sys/fs/nullfs/null.h b/sys/fs/nullfs/null.h index f796d18c6706..fcd179e73afb 100644 --- a/sys/fs/nullfs/null.h +++ b/sys/fs/nullfs/null.h @@ -63,7 +63,7 @@ extern int null_node_create __P((struct mount *mp, struct vnode *target, struct #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) #define VTONULL(vp) ((struct null_node *)(vp)->v_data) #define NULLTOV(xp) ((xp)->null_vnode) -#ifdef NULLFS_DIAGNOSTIC +#ifdef DIAGNOSTIC extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno)); #define NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__) #else diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index 1504fc84ac0e..ad37a1ef4788 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -38,8 +38,6 @@ * $FreeBSD$ */ -#include "opt_debug_nullfs.h" - #include #include #include @@ -77,7 +75,7 @@ nullfs_init(vfsp) struct vfsconf *vfsp; { -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_init\n"); /* printed during system boot */ #endif null_node_hashtbl = hashinit(NNULLNODECACHE, M_CACHE, &null_node_hash); @@ -198,7 +196,7 @@ null_node_create(mp, lowervp, newvpp) * null_node_find has taken another reference * to the alias vnode. */ -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG vprint("null_node_create: exists", aliasvp); #endif /* VREF(aliasvp); --- done in null_node_find */ @@ -208,7 +206,7 @@ null_node_create(mp, lowervp, newvpp) /* * Get new vnode. */ -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("null_node_create: create new alias vnode\n"); #endif @@ -235,7 +233,7 @@ null_node_create(mp, lowervp, newvpp) }; #endif -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG vprint("null_node_create: alias", aliasvp); vprint("null_node_create: lower", lowervp); #endif @@ -244,7 +242,7 @@ null_node_create(mp, lowervp, newvpp) return (0); } -#ifdef NULLFS_DIAGNOSTIC +#ifdef DIAGNOSTIC #include "opt_ddb.h" #ifdef DDB diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index f6ac5a0f749a..730eb80c86de 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -44,8 +44,6 @@ * (See null_vnops.c for a description of what this does.) */ -#include "opt_debug_nullfs.h" - #include #include #include @@ -96,7 +94,7 @@ nullfs_mount(mp, path, data, ndp, p) u_int size; int isvnunlocked = 0; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_mount(mp = %p)\n", (void *)mp); #endif @@ -151,7 +149,7 @@ nullfs_mount(mp, path, data, ndp, p) * Check multi null mount to avoid `lock against myself' panic. */ if (lowerrootvp == VTONULL(mp->mnt_vnodecovered)->null_lowervp) { -#ifdef DIAGNOSTIC +#ifdef DEBUG printf("nullfs_mount: multi null mount?\n"); #endif return (EDEADLK); @@ -201,7 +199,7 @@ nullfs_mount(mp, path, data, ndp, p) &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); (void)nullfs_statfs(mp, &mp->mnt_stat, p); -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_mount: lower %s, alias at %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); #endif @@ -236,7 +234,7 @@ nullfs_unmount(mp, mntflags, p) int error; int flags = 0; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_unmount(mp = %p)\n", (void *)mp); #endif @@ -259,7 +257,7 @@ nullfs_unmount(mp, mntflags, p) if (error) return (error); -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG vprint("alias root of lower", nullm_rootvp); #endif /* @@ -286,7 +284,7 @@ nullfs_root(mp, vpp) struct proc *p = curproc; /* XXX */ struct vnode *vp; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_root(mp = %p, vp = %p->%p)\n", (void *)mp, (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); @@ -302,7 +300,7 @@ nullfs_root(mp, vpp) * XXX * Should we check type of node? */ -#ifdef DIAGNOSTIC +#ifdef DEBUG printf("nullfs_root: multi null mount?\n"); #endif vrele(vp); @@ -333,7 +331,7 @@ nullfs_statfs(mp, sbp, p) int error; struct statfs mstat; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_statfs(mp = %p, vp = %p->%p)\n", (void *)mp, (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 6156d0f3c734..225ac09ad5da 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -174,8 +174,6 @@ * */ -#include "opt_debug_nullfs.h" - #include #include #include diff --git a/sys/miscfs/nullfs/null.h b/sys/miscfs/nullfs/null.h index f796d18c6706..fcd179e73afb 100644 --- a/sys/miscfs/nullfs/null.h +++ b/sys/miscfs/nullfs/null.h @@ -63,7 +63,7 @@ extern int null_node_create __P((struct mount *mp, struct vnode *target, struct #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) #define VTONULL(vp) ((struct null_node *)(vp)->v_data) #define NULLTOV(xp) ((xp)->null_vnode) -#ifdef NULLFS_DIAGNOSTIC +#ifdef DIAGNOSTIC extern struct vnode *null_checkvp __P((struct vnode *vp, char *fil, int lno)); #define NULLVPTOLOWERVP(vp) null_checkvp((vp), __FILE__, __LINE__) #else diff --git a/sys/miscfs/nullfs/null_subr.c b/sys/miscfs/nullfs/null_subr.c index 1504fc84ac0e..ad37a1ef4788 100644 --- a/sys/miscfs/nullfs/null_subr.c +++ b/sys/miscfs/nullfs/null_subr.c @@ -38,8 +38,6 @@ * $FreeBSD$ */ -#include "opt_debug_nullfs.h" - #include #include #include @@ -77,7 +75,7 @@ nullfs_init(vfsp) struct vfsconf *vfsp; { -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_init\n"); /* printed during system boot */ #endif null_node_hashtbl = hashinit(NNULLNODECACHE, M_CACHE, &null_node_hash); @@ -198,7 +196,7 @@ null_node_create(mp, lowervp, newvpp) * null_node_find has taken another reference * to the alias vnode. */ -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG vprint("null_node_create: exists", aliasvp); #endif /* VREF(aliasvp); --- done in null_node_find */ @@ -208,7 +206,7 @@ null_node_create(mp, lowervp, newvpp) /* * Get new vnode. */ -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("null_node_create: create new alias vnode\n"); #endif @@ -235,7 +233,7 @@ null_node_create(mp, lowervp, newvpp) }; #endif -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG vprint("null_node_create: alias", aliasvp); vprint("null_node_create: lower", lowervp); #endif @@ -244,7 +242,7 @@ null_node_create(mp, lowervp, newvpp) return (0); } -#ifdef NULLFS_DIAGNOSTIC +#ifdef DIAGNOSTIC #include "opt_ddb.h" #ifdef DDB diff --git a/sys/miscfs/nullfs/null_vfsops.c b/sys/miscfs/nullfs/null_vfsops.c index f6ac5a0f749a..730eb80c86de 100644 --- a/sys/miscfs/nullfs/null_vfsops.c +++ b/sys/miscfs/nullfs/null_vfsops.c @@ -44,8 +44,6 @@ * (See null_vnops.c for a description of what this does.) */ -#include "opt_debug_nullfs.h" - #include #include #include @@ -96,7 +94,7 @@ nullfs_mount(mp, path, data, ndp, p) u_int size; int isvnunlocked = 0; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_mount(mp = %p)\n", (void *)mp); #endif @@ -151,7 +149,7 @@ nullfs_mount(mp, path, data, ndp, p) * Check multi null mount to avoid `lock against myself' panic. */ if (lowerrootvp == VTONULL(mp->mnt_vnodecovered)->null_lowervp) { -#ifdef DIAGNOSTIC +#ifdef DEBUG printf("nullfs_mount: multi null mount?\n"); #endif return (EDEADLK); @@ -201,7 +199,7 @@ nullfs_mount(mp, path, data, ndp, p) &size); bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size); (void)nullfs_statfs(mp, &mp->mnt_stat, p); -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_mount: lower %s, alias at %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); #endif @@ -236,7 +234,7 @@ nullfs_unmount(mp, mntflags, p) int error; int flags = 0; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_unmount(mp = %p)\n", (void *)mp); #endif @@ -259,7 +257,7 @@ nullfs_unmount(mp, mntflags, p) if (error) return (error); -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG vprint("alias root of lower", nullm_rootvp); #endif /* @@ -286,7 +284,7 @@ nullfs_root(mp, vpp) struct proc *p = curproc; /* XXX */ struct vnode *vp; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_root(mp = %p, vp = %p->%p)\n", (void *)mp, (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); @@ -302,7 +300,7 @@ nullfs_root(mp, vpp) * XXX * Should we check type of node? */ -#ifdef DIAGNOSTIC +#ifdef DEBUG printf("nullfs_root: multi null mount?\n"); #endif vrele(vp); @@ -333,7 +331,7 @@ nullfs_statfs(mp, sbp, p) int error; struct statfs mstat; -#ifdef NULLFS_DIAGNOSTIC +#ifdef DEBUG printf("nullfs_statfs(mp = %p, vp = %p->%p)\n", (void *)mp, (void *)MOUNTTONULLMOUNT(mp)->nullm_rootvp, (void *)NULLVPTOLOWERVP(MOUNTTONULLMOUNT(mp)->nullm_rootvp)); diff --git a/sys/miscfs/nullfs/null_vnops.c b/sys/miscfs/nullfs/null_vnops.c index 6156d0f3c734..225ac09ad5da 100644 --- a/sys/miscfs/nullfs/null_vnops.c +++ b/sys/miscfs/nullfs/null_vnops.c @@ -174,8 +174,6 @@ * */ -#include "opt_debug_nullfs.h" - #include #include #include