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.
This commit is contained in:
parent
f054c29093
commit
47966f4c8a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50552
@ -111,8 +111,8 @@ kernfs_mount(mp, path, data, ndp, p)
|
|||||||
struct kernfs_mount *fmp;
|
struct kernfs_mount *fmp;
|
||||||
struct vnode *rvp;
|
struct vnode *rvp;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_mount(mp = %x)\n", mp);
|
printf("kernfs_mount(mp = %p)\n", (void *)mp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -132,8 +132,8 @@ kernfs_mount(mp, path, data, ndp, p)
|
|||||||
|
|
||||||
rvp->v_type = VDIR;
|
rvp->v_type = VDIR;
|
||||||
rvp->v_flag |= VROOT;
|
rvp->v_flag |= VROOT;
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_mount: root vp = %x\n", rvp);
|
printf("kernfs_mount: root vp = %p\n", (void *)rvp);
|
||||||
#endif
|
#endif
|
||||||
fmp->kf_root = rvp;
|
fmp->kf_root = rvp;
|
||||||
mp->mnt_flag |= MNT_LOCAL;
|
mp->mnt_flag |= MNT_LOCAL;
|
||||||
@ -145,7 +145,7 @@ kernfs_mount(mp, path, data, ndp, p)
|
|||||||
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
|
bzero(mp->mnt_stat.f_mntfromname, MNAMELEN);
|
||||||
bcopy("kernfs", mp->mnt_stat.f_mntfromname, sizeof("kernfs"));
|
bcopy("kernfs", mp->mnt_stat.f_mntfromname, sizeof("kernfs"));
|
||||||
(void)kernfs_statfs(mp, &mp->mnt_stat, p);
|
(void)kernfs_statfs(mp, &mp->mnt_stat, p);
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_mount: at %s\n", mp->mnt_stat.f_mntonname);
|
printf("kernfs_mount: at %s\n", mp->mnt_stat.f_mntonname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -172,8 +172,8 @@ kernfs_unmount(mp, mntflags, p)
|
|||||||
int flags = 0;
|
int flags = 0;
|
||||||
struct vnode *rootvp = VFSTOKERNFS(mp)->kf_root;
|
struct vnode *rootvp = VFSTOKERNFS(mp)->kf_root;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_unmount(mp = %x)\n", mp);
|
printf("kernfs_unmount(mp = %p)\n", (void *)mp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mntflags & MNT_FORCE)
|
if (mntflags & MNT_FORCE)
|
||||||
@ -186,14 +186,14 @@ kernfs_unmount(mp, mntflags, p)
|
|||||||
*/
|
*/
|
||||||
if (rootvp->v_usecount > 1)
|
if (rootvp->v_usecount > 1)
|
||||||
return (EBUSY);
|
return (EBUSY);
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_unmount: calling vflush\n");
|
printf("kernfs_unmount: calling vflush\n");
|
||||||
#endif
|
#endif
|
||||||
error = vflush(mp, rootvp, flags);
|
error = vflush(mp, rootvp, flags);
|
||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
vprint("kernfs root", rootvp);
|
vprint("kernfs root", rootvp);
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
@ -220,8 +220,8 @@ kernfs_root(mp, vpp)
|
|||||||
struct proc *p = curproc; /* XXX */
|
struct proc *p = curproc; /* XXX */
|
||||||
struct vnode *vp;
|
struct vnode *vp;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_root(mp = %x)\n", mp);
|
printf("kernfs_root(mp = %p)\n", (void *)mp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -240,8 +240,8 @@ kernfs_statfs(mp, sbp, p)
|
|||||||
struct statfs *sbp;
|
struct statfs *sbp;
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
{
|
{
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_statfs(mp = %x)\n", mp);
|
printf("kernfs_statfs(mp = %p)\n", (void *)mp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sbp->f_flags = 0;
|
sbp->f_flags = 0;
|
||||||
|
@ -235,9 +235,10 @@ kernfs_lookup(ap)
|
|||||||
struct vnode *fvp;
|
struct vnode *fvp;
|
||||||
int error, i;
|
int error, i;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_lookup(%x)\n", ap);
|
printf("kernfs_lookup(%p)\n", (void *)ap);
|
||||||
printf("kernfs_lookup(dp = %x, vpp = %x, cnp = %x)\n", dvp, vpp, ap->a_cnp);
|
printf("kernfs_lookup(dp = %p, vpp = %p, cnp = %p)\n",
|
||||||
|
(void *)dvp, (void *)vpp, (void *)ap->a_cnp);
|
||||||
printf("kernfs_lookup(%s)\n", pname);
|
printf("kernfs_lookup(%s)\n", pname);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -269,7 +270,7 @@ kernfs_lookup(ap)
|
|||||||
goto found;
|
goto found;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_lookup: i = %d, failed", i);
|
printf("kernfs_lookup: i = %d, failed", i);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -290,7 +291,7 @@ kernfs_lookup(ap)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_lookup: allocate new vnode\n");
|
printf("kernfs_lookup: allocate new vnode\n");
|
||||||
#endif
|
#endif
|
||||||
if ((error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p,
|
if ((error = getnewvnode(VT_KERNFS, dvp->v_mount, kernfs_vnodeop_p,
|
||||||
@ -306,8 +307,8 @@ kernfs_lookup(ap)
|
|||||||
vn_lock(fvp, LK_SHARED | LK_RETRY, p);
|
vn_lock(fvp, LK_SHARED | LK_RETRY, p);
|
||||||
*vpp = fvp;
|
*vpp = fvp;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_lookup: newvp = %x\n", fvp);
|
printf("kernfs_lookup: newvp = %p\n", (void *)fvp);
|
||||||
#endif
|
#endif
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -389,7 +390,7 @@ kernfs_getattr(ap)
|
|||||||
vap->va_bytes = 0;
|
vap->va_bytes = 0;
|
||||||
|
|
||||||
if (vp->v_flag & VROOT) {
|
if (vp->v_flag & VROOT) {
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_getattr: stat rootdir\n");
|
printf("kernfs_getattr: stat rootdir\n");
|
||||||
#endif
|
#endif
|
||||||
vap->va_type = VDIR;
|
vap->va_type = VDIR;
|
||||||
@ -400,7 +401,7 @@ kernfs_getattr(ap)
|
|||||||
} else {
|
} else {
|
||||||
struct kern_target *kt = VTOKERN(vp)->kf_kt;
|
struct kern_target *kt = VTOKERN(vp)->kf_kt;
|
||||||
int nbytes;
|
int nbytes;
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_getattr: stat target %s\n", kt->kt_name);
|
printf("kernfs_getattr: stat target %s\n", kt->kt_name);
|
||||||
#endif
|
#endif
|
||||||
vap->va_type = kt->kt_vtype;
|
vap->va_type = kt->kt_vtype;
|
||||||
@ -411,7 +412,7 @@ kernfs_getattr(ap)
|
|||||||
vap->va_size = nbytes;
|
vap->va_size = nbytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_getattr: return error %d\n", error);
|
printf("kernfs_getattr: return error %d\n", error);
|
||||||
#endif
|
#endif
|
||||||
return (error);
|
return (error);
|
||||||
@ -460,7 +461,7 @@ kernfs_read(ap)
|
|||||||
|
|
||||||
kt = VTOKERN(vp)->kf_kt;
|
kt = VTOKERN(vp)->kf_kt;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kern_read %s\n", kt->kt_name);
|
printf("kern_read %s\n", kt->kt_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -536,7 +537,7 @@ kernfs_readdir(ap)
|
|||||||
for (kt = &kern_targets[i];
|
for (kt = &kern_targets[i];
|
||||||
uio->uio_resid >= UIO_MX && i < nkern_targets; kt++, i++) {
|
uio->uio_resid >= UIO_MX && i < nkern_targets; kt++, i++) {
|
||||||
struct dirent *dp = &d;
|
struct dirent *dp = &d;
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_readdir: i = %d\n", i);
|
printf("kernfs_readdir: i = %d\n", i);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -552,7 +553,7 @@ kernfs_readdir(ap)
|
|||||||
dp->d_namlen = kt->kt_namlen;
|
dp->d_namlen = kt->kt_namlen;
|
||||||
bcopy(kt->kt_name, dp->d_name, kt->kt_namlen+1);
|
bcopy(kt->kt_name, dp->d_name, kt->kt_namlen+1);
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_readdir: name = %s, len = %d\n",
|
printf("kernfs_readdir: name = %s, len = %d\n",
|
||||||
dp->d_name, dp->d_namlen);
|
dp->d_name, dp->d_namlen);
|
||||||
#endif
|
#endif
|
||||||
@ -583,8 +584,8 @@ kernfs_inactive(ap)
|
|||||||
{
|
{
|
||||||
struct vnode *vp = ap->a_vp;
|
struct vnode *vp = ap->a_vp;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_inactive(%x)\n", vp);
|
printf("kernfs_inactive(%p)\n", (void *)vp);
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Clear out the v_type field to avoid
|
* Clear out the v_type field to avoid
|
||||||
@ -603,8 +604,8 @@ kernfs_reclaim(ap)
|
|||||||
{
|
{
|
||||||
struct vnode *vp = ap->a_vp;
|
struct vnode *vp = ap->a_vp;
|
||||||
|
|
||||||
#ifdef KERNFS_DIAGNOSTIC
|
#ifdef DEBUG
|
||||||
printf("kernfs_reclaim(%x)\n", vp);
|
printf("kernfs_reclaim(%p)\n", (void *)vp);
|
||||||
#endif
|
#endif
|
||||||
if (vp->v_data) {
|
if (vp->v_data) {
|
||||||
FREE(vp->v_data, M_TEMP);
|
FREE(vp->v_data, M_TEMP);
|
||||||
|
Loading…
Reference in New Issue
Block a user