mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-23 09:23:00 +01:00
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 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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user