diff options
author | Bruce Evans <bde@FreeBSD.org> | 1999-08-29 09:38:25 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1999-08-29 09:38:25 +0000 |
commit | 47966f4c8af1a3481d934398e61ea56edb5839f1 (patch) | |
tree | 6c7b269b825ca0286705c59529f0fb5ad6926c06 /sys | |
parent | f054c29093fd43702ee6ed42be37f17552b7b7bb (diff) | |
download | src-47966f4c8af1a3481d934398e61ea56edb5839f1.tar.gz src-47966f4c8af1a3481d934398e61ea56edb5839f1.zip |
Changed old-style option KERNFS_DIAGNOSTIC to DEBUG and fixed printf
format errors exposed by this. It has nothing to do with diagnostics
since it does little more than control tracing of normal operation.
Notes
Notes:
svn path=/head/; revision=50552
Diffstat (limited to 'sys')
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vfsops.c | 26 | ||||
-rw-r--r-- | sys/miscfs/kernfs/kernfs_vnops.c | 35 |
2 files changed, 31 insertions, 30 deletions
diff --git a/sys/miscfs/kernfs/kernfs_vfsops.c b/sys/miscfs/kernfs/kernfs_vfsops.c index 522f77d00877..85a63b73f2a3 100644 --- a/sys/miscfs/kernfs/kernfs_vfsops.c +++ b/sys/miscfs/kernfs/kernfs_vfsops.c @@ -111,8 +111,8 @@ kernfs_mount(mp, path, data, ndp, p) struct kernfs_mount *fmp; struct vnode *rvp; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_mount(mp = %x)\n", mp); +#ifdef DEBUG + printf("kernfs_mount(mp = %p)\n", (void *)mp); #endif /* @@ -132,8 +132,8 @@ kernfs_mount(mp, path, data, ndp, p) rvp->v_type = VDIR; rvp->v_flag |= VROOT; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_mount: root vp = %x\n", rvp); +#ifdef DEBUG + printf("kernfs_mount: root vp = %p\n", (void *)rvp); #endif fmp->kf_root = rvp; mp->mnt_flag |= MNT_LOCAL; @@ -145,7 +145,7 @@ kernfs_mount(mp, path, data, ndp, p) bzero(mp->mnt_stat.f_mntfromname, MNAMELEN); bcopy("kernfs", mp->mnt_stat.f_mntfromname, sizeof("kernfs")); (void)kernfs_statfs(mp, &mp->mnt_stat, p); -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_mount: at %s\n", mp->mnt_stat.f_mntonname); #endif @@ -172,8 +172,8 @@ kernfs_unmount(mp, mntflags, p) int flags = 0; struct vnode *rootvp = VFSTOKERNFS(mp)->kf_root; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_unmount(mp = %x)\n", mp); +#ifdef DEBUG + printf("kernfs_unmount(mp = %p)\n", (void *)mp); #endif if (mntflags & MNT_FORCE) @@ -186,14 +186,14 @@ kernfs_unmount(mp, mntflags, p) */ if (rootvp->v_usecount > 1) return (EBUSY); -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_unmount: calling vflush\n"); #endif error = vflush(mp, rootvp, flags); if (error) return (error); -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG vprint("kernfs root", rootvp); #endif /* @@ -220,8 +220,8 @@ kernfs_root(mp, vpp) struct proc *p = curproc; /* XXX */ struct vnode *vp; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_root(mp = %x)\n", mp); +#ifdef DEBUG + printf("kernfs_root(mp = %p)\n", (void *)mp); #endif /* @@ -240,8 +240,8 @@ kernfs_statfs(mp, sbp, p) struct statfs *sbp; struct proc *p; { -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_statfs(mp = %x)\n", mp); +#ifdef DEBUG + printf("kernfs_statfs(mp = %p)\n", (void *)mp); #endif sbp->f_flags = 0; diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 0488709374dd..6d4f6f57c5bb 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -235,9 +235,10 @@ kernfs_lookup(ap) struct vnode *fvp; int error, i; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_lookup(%x)\n", ap); - printf("kernfs_lookup(dp = %x, vpp = %x, cnp = %x)\n", dvp, vpp, ap->a_cnp); +#ifdef DEBUG + printf("kernfs_lookup(%p)\n", (void *)ap); + printf("kernfs_lookup(dp = %p, vpp = %p, cnp = %p)\n", + (void *)dvp, (void *)vpp, (void *)ap->a_cnp); printf("kernfs_lookup(%s)\n", pname); #endif @@ -269,7 +270,7 @@ kernfs_lookup(ap) goto found; } -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_lookup: i = %d, failed", i); #endif @@ -290,7 +291,7 @@ found: return (0); } -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_lookup: allocate new vnode\n"); #endif if ((error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p, @@ -306,8 +307,8 @@ found: vn_lock(fvp, LK_SHARED | LK_RETRY, p); *vpp = fvp; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_lookup: newvp = %x\n", fvp); +#ifdef DEBUG + printf("kernfs_lookup: newvp = %p\n", (void *)fvp); #endif return (0); } @@ -389,7 +390,7 @@ kernfs_getattr(ap) vap->va_bytes = 0; if (vp->v_flag & VROOT) { -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_getattr: stat rootdir\n"); #endif vap->va_type = VDIR; @@ -400,7 +401,7 @@ kernfs_getattr(ap) } else { struct kern_target *kt = VTOKERN(vp)->kf_kt; int nbytes; -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_getattr: stat target %s\n", kt->kt_name); #endif vap->va_type = kt->kt_vtype; @@ -411,7 +412,7 @@ kernfs_getattr(ap) vap->va_size = nbytes; } -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_getattr: return error %d\n", error); #endif return (error); @@ -460,7 +461,7 @@ kernfs_read(ap) kt = VTOKERN(vp)->kf_kt; -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kern_read %s\n", kt->kt_name); #endif @@ -536,7 +537,7 @@ kernfs_readdir(ap) for (kt = &kern_targets[i]; uio->uio_resid >= UIO_MX && i < nkern_targets; kt++, i++) { struct dirent *dp = &d; -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_readdir: i = %d\n", i); #endif @@ -552,7 +553,7 @@ kernfs_readdir(ap) dp->d_namlen = kt->kt_namlen; bcopy(kt->kt_name, dp->d_name, kt->kt_namlen+1); -#ifdef KERNFS_DIAGNOSTIC +#ifdef DEBUG printf("kernfs_readdir: name = %s, len = %d\n", dp->d_name, dp->d_namlen); #endif @@ -583,8 +584,8 @@ kernfs_inactive(ap) { struct vnode *vp = ap->a_vp; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_inactive(%x)\n", vp); +#ifdef DEBUG + printf("kernfs_inactive(%p)\n", (void *)vp); #endif /* * Clear out the v_type field to avoid @@ -603,8 +604,8 @@ kernfs_reclaim(ap) { struct vnode *vp = ap->a_vp; -#ifdef KERNFS_DIAGNOSTIC - printf("kernfs_reclaim(%x)\n", vp); +#ifdef DEBUG + printf("kernfs_reclaim(%p)\n", (void *)vp); #endif if (vp->v_data) { FREE(vp->v_data, M_TEMP); |