summaryrefslogtreecommitdiffstats
path: root/sys/miscfs/umapfs
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-08-29 09:54:17 +0000
committerbde <bde@FreeBSD.org>1999-08-29 09:54:17 +0000
commitb0ec7e875858d5fa19b1582a4fe4c3b8bf96213a (patch)
treed2fddbf12a0b8484b478f6fa56156d6fd6dfeb24 /sys/miscfs/umapfs
parentb2ea6809d4c95f0b6318b2820e37f78fa9d68d01 (diff)
downloadFreeBSD-src-b0ec7e875858d5fa19b1582a4fe4c3b8bf96213a.zip
FreeBSD-src-b0ec7e875858d5fa19b1582a4fe4c3b8bf96213a.tar.gz
Changed old-style options UMAPFS_DIAGNOSTIC and UMAP_DIAGNOSTIC to DEBUG
or DDB and fixed printf format errors exposed by this. The options had little to do with diagnostics; they mostly controlled tracing of normal operation.
Diffstat (limited to 'sys/miscfs/umapfs')
-rw-r--r--sys/miscfs/umapfs/umap.h2
-rw-r--r--sys/miscfs/umapfs/umap_subr.c34
-rw-r--r--sys/miscfs/umapfs/umap_vfsops.c48
3 files changed, 43 insertions, 41 deletions
diff --git a/sys/miscfs/umapfs/umap.h b/sys/miscfs/umapfs/umap.h
index 09963cb..854fb8c 100644
--- a/sys/miscfs/umapfs/umap.h
+++ b/sys/miscfs/umapfs/umap.h
@@ -80,7 +80,7 @@ extern void umap_mapids __P((struct mount *v_mount, struct ucred *credp));
#define MOUNTTOUMAPMOUNT(mp) ((struct umap_mount *)((mp)->mnt_data))
#define VTOUMAP(vp) ((struct umap_node *)(vp)->v_data)
#define UMAPTOV(xp) ((xp)->umap_vnode)
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DDB
extern struct vnode *umap_checkvp __P((struct vnode *vp, char *fil, int lno));
#define UMAPVPTOLOWERVP(vp) umap_checkvp((vp), __FILE__, __LINE__)
#else
diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c
index ed316a9..a4b8fbe 100644
--- a/sys/miscfs/umapfs/umap_subr.c
+++ b/sys/miscfs/umapfs/umap_subr.c
@@ -38,6 +38,8 @@
* $FreeBSD$
*/
+#include "opt_ddb.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
@@ -77,7 +79,7 @@ umapfs_init(vfsp)
struct vfsconf *vfsp;
{
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
printf("umapfs_init\n"); /* printed during system boot */
#endif
umap_node_hashtbl = hashinit(NUMAPNODECACHE, M_CACHE, &umap_node_hash);
@@ -145,8 +147,9 @@ umap_node_find(mp, targetvp)
struct umap_node *a;
struct vnode *vp;
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umap_node_find(mp = %x, target = %x)\n", mp, targetvp);
+#ifdef DEBUG
+ printf("umap_node_find(mp = %p, target = %p)\n",
+ (void *)mp, (void *)targetvp);
#endif
/*
@@ -167,7 +170,7 @@ loop:
* the lower node.
*/
if (vget(vp, 0, p)) {
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
printf ("umap_node_find: vget failed.\n");
#endif
goto loop;
@@ -176,8 +179,9 @@ loop:
}
}
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umap_node_find(%x, %x): NOT found\n", mp, targetvp);
+#ifdef DEBUG
+ printf("umap_node_find(%p, %p): NOT found\n",
+ (void *)mp, (void *)targetvp);
#endif
return (0);
@@ -258,7 +262,7 @@ umap_node_create(mp, targetvp, newvpp)
/*
* Take another reference to the alias vnode
*/
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
vprint("umap_node_create: exists", aliasvp);
#endif
/* VREF(aliasvp); */
@@ -268,7 +272,7 @@ umap_node_create(mp, targetvp, newvpp)
/*
* Get new vnode.
*/
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
printf("umap_node_create: create new alias vnode\n");
#endif
/*
@@ -285,7 +289,7 @@ umap_node_create(mp, targetvp, newvpp)
vrele(targetvp);
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
vprint("umap_node_create: alias", aliasvp);
vprint("umap_node_create: target", targetvp);
#endif
@@ -294,7 +298,7 @@ umap_node_create(mp, targetvp, newvpp)
return (0);
}
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DDB
int umap_checkvp_barrier = 1;
struct vnode *
umap_checkvp(vp, fil, lno)
@@ -317,9 +321,9 @@ umap_checkvp(vp, fil, lno)
if (a->umap_lowervp == NULL) {
/* Should never happen */
int i; u_long *p;
- printf("vp = %x, ZERO ptr\n", vp);
+ printf("vp = %p, ZERO ptr\n", (void *)vp);
for (p = (u_long *) a, i = 0; i < 8; i++)
- printf(" %x", p[i]);
+ printf(" %p", (void *)p[i]);
printf("\n");
/* wait for debugger */
while (umap_checkvp_barrier) /*WAIT*/ ;
@@ -327,9 +331,9 @@ umap_checkvp(vp, fil, lno)
}
if (a->umap_lowervp->v_usecount < 1) {
int i; u_long *p;
- printf("vp = %x, unref'ed lowervp\n", vp);
+ printf("vp = %p, unref'ed lowervp\n", (void *)vp);
for (p = (u_long *) a, i = 0; i < 8; i++)
- printf(" %x", p[i]);
+ printf(" %p", (void *)p[i]);
printf("\n");
/* wait for debugger */
while (umap_checkvp_barrier) /*WAIT*/ ;
@@ -343,7 +347,7 @@ umap_checkvp(vp, fil, lno)
#endif
return (a->umap_lowervp);
}
-#endif
+#endif /* DDB */
/* umap_mapids maps all of the ids in a credential, both user and group. */
diff --git a/sys/miscfs/umapfs/umap_vfsops.c b/sys/miscfs/umapfs/umap_vfsops.c
index 658a4ce..005862a 100644
--- a/sys/miscfs/umapfs/umap_vfsops.c
+++ b/sys/miscfs/umapfs/umap_vfsops.c
@@ -91,7 +91,7 @@ umapfs_mount(mp, path, data, ndp, p)
struct umap_mount *amp;
u_int size;
int error;
-#ifdef UMAP_DIAGNOSTIC
+#ifdef DEBUG
int i;
#endif
@@ -101,8 +101,8 @@ umapfs_mount(mp, path, data, ndp, p)
if ((error = suser(p)) != 0)
return (error);
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umapfs_mount(mp = %x)\n", mp);
+#ifdef DEBUG
+ printf("umapfs_mount(mp = %p)\n", (void *)mp);
#endif
/*
@@ -133,8 +133,8 @@ umapfs_mount(mp, path, data, ndp, p)
* Sanity check on lower vnode
*/
lowerrootvp = ndp->ni_vp;
-#ifdef UMAPFS_DIAGNOSTIC
- printf("vp = %x, check for VDIR...\n", lowerrootvp);
+#ifdef DEBUG
+ printf("vp = %p, check for VDIR...\n", (void *)lowerrootvp);
#endif
vrele(ndp->ni_dvp);
ndp->ni_dvp = 0;
@@ -144,8 +144,8 @@ umapfs_mount(mp, path, data, ndp, p)
return (EINVAL);
}
-#ifdef UMAPFS_DIAGNOSTIC
- printf("mp = %x\n", mp);
+#ifdef DEBUG
+ printf("mp = %p\n", (void *)mp);
#endif
amp = (struct umap_mount *) malloc(sizeof(struct umap_mount),
@@ -166,10 +166,10 @@ umapfs_mount(mp, path, data, ndp, p)
if (error)
return (error);
-#ifdef UMAP_DIAGNOSTIC
+#ifdef DEBUG
printf("umap_mount:nentries %d\n",args.nentries);
for (i = 0; i < args.nentries; i++)
- printf(" %d maps to %d\n", amp->info_mapdata[i][0],
+ printf(" %lu maps to %lu\n", amp->info_mapdata[i][0],
amp->info_mapdata[i][1]);
#endif
@@ -178,10 +178,10 @@ umapfs_mount(mp, path, data, ndp, p)
if (error)
return (error);
-#ifdef UMAP_DIAGNOSTIC
+#ifdef DEBUG
printf("umap_mount:gnentries %d\n",args.gnentries);
for (i = 0; i < args.gnentries; i++)
- printf(" group %d maps to %d\n",
+ printf(" group %lu maps to %lu\n",
amp->info_gmapdata[i][0],
amp->info_gmapdata[i][1]);
#endif
@@ -223,7 +223,7 @@ umapfs_mount(mp, path, data, ndp, p)
&size);
bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
(void)umapfs_statfs(mp, &mp->mnt_stat, p);
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
printf("umapfs_mount: lower %s, alias at %s\n",
mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname);
#endif
@@ -258,8 +258,8 @@ umapfs_unmount(mp, mntflags, p)
int error;
int flags = 0;
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umapfs_unmount(mp = %x)\n", mp);
+#ifdef DEBUG
+ printf("umapfs_unmount(mp = %p)\n", (void *)mp);
#endif
if (mntflags & MNT_FORCE)
@@ -281,7 +281,7 @@ umapfs_unmount(mp, mntflags, p)
if (error)
return (error);
-#ifdef UMAPFS_DIAGNOSTIC
+#ifdef DEBUG
vprint("alias root of lower", umapm_rootvp);
#endif
/*
@@ -308,11 +308,10 @@ umapfs_root(mp, vpp)
struct proc *p = curproc; /* XXX */
struct vnode *vp;
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umapfs_root(mp = %x, vp = %x->%x)\n", mp,
- MOUNTTOUMAPMOUNT(mp)->umapm_rootvp,
- UMAPVPTOLOWERVP(MOUNTTOUMAPMOUNT(mp)->umapm_rootvp)
- );
+#ifdef DEBUG
+ printf("umapfs_root(mp = %p, vp = %p->%p)\n",
+ (void *)mp, (void *)MOUNTTOUMAPMOUNT(mp)->umapm_rootvp,
+ (void *)UMAPVPTOLOWERVP(MOUNTTOUMAPMOUNT(mp)->umapm_rootvp));
#endif
/*
@@ -345,11 +344,10 @@ umapfs_statfs(mp, sbp, p)
int error;
struct statfs mstat;
-#ifdef UMAPFS_DIAGNOSTIC
- printf("umapfs_statfs(mp = %x, vp = %x->%x)\n", mp,
- MOUNTTOUMAPMOUNT(mp)->umapm_rootvp,
- UMAPVPTOLOWERVP(MOUNTTOUMAPMOUNT(mp)->umapm_rootvp)
- );
+#ifdef DEBUG
+ printf("umapfs_statfs(mp = %p, vp = %p->%p)\n",
+ (void *)mp, (void *)MOUNTTOUMAPMOUNT(mp)->umapm_rootvp,
+ (void *)UMAPVPTOLOWERVP(MOUNTTOUMAPMOUNT(mp)->umapm_rootvp));
#endif
bzero(&mstat, sizeof(mstat));
OpenPOWER on IntegriCloud