printf -> kprintf, sprintf -> ksprintf

This commit is contained in:
christos 1996-10-10 17:16:17 +00:00
parent d9add485a7
commit de1b2b437e
22 changed files with 246 additions and 240 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.12 1996/10/10 17:21:13 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -105,7 +105,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_fs;
#ifdef DIAGNOSTIC
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%x, bsize = %d, size = %d, fs = %s\n",
kprintf("dev = 0x%x, bsize = %d, size = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
@ -173,7 +173,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
#ifdef DIAGNOSTIC
if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
kprintf(
"dev = 0x%x, bsize = %d, osize = %d, nsize = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
@ -184,7 +184,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
kprintf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev");
}
@ -259,7 +259,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
fs->fs_optim = FS_OPTSPACE;
break;
default:
printf("dev = 0x%x, optim = %d, fs = %s\n",
kprintf("dev = 0x%x, optim = %d, fs = %s\n",
ip->i_dev, fs->fs_optim, fs->fs_fsmnt);
panic("ffs_realloccg: bad optim");
/* NOTREACHED */
@ -414,7 +414,7 @@ ffs_reallocblks(v)
*/
#ifdef DEBUG
if (prtrealloc)
printf("realloc: ino %d, lbns %d-%d\n\told:", ip->i_number,
kprintf("realloc: ino %d, lbns %d-%d\n\told:", ip->i_number,
start_lbn, end_lbn);
#endif
blkno = newblk;
@ -427,7 +427,7 @@ ffs_reallocblks(v)
#endif
#ifdef DEBUG
if (prtrealloc)
printf(" %d,", *bap);
kprintf(" %d,", *bap);
#endif
*bap++ = blkno;
}
@ -467,7 +467,7 @@ ffs_reallocblks(v)
*/
#ifdef DEBUG
if (prtrealloc)
printf("\n\tnew:");
kprintf("\n\tnew:");
#endif
for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) {
ffs_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno),
@ -475,13 +475,13 @@ ffs_reallocblks(v)
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
#ifdef DEBUG
if (prtrealloc)
printf(" %d,", blkno);
kprintf(" %d,", blkno);
#endif
}
#ifdef DEBUG
if (prtrealloc) {
prtrealloc--;
printf("\n");
kprintf("\n");
}
#endif
return (0);
@ -550,12 +550,12 @@ ffs_valloc(v)
}
ip = VTOI(*ap->a_vpp);
if (ip->i_mode) {
printf("mode = 0%o, inum = %d, fs = %s\n",
kprintf("mode = 0%o, inum = %d, fs = %s\n",
ip->i_mode, ip->i_number, fs->fs_fsmnt);
panic("ffs_valloc: dup alloc");
}
if (ip->i_blocks) { /* XXX */
printf("free inode %s/%d had %d blocks\n",
kprintf("free inode %s/%d had %d blocks\n",
fs->fs_fsmnt, ino, ip->i_blocks);
ip->i_blocks = 0;
}
@ -976,7 +976,7 @@ ffs_alloccgblk(fs, cgp, bpref)
pos = cylno % fs->fs_cpc;
bno = (cylno - pos) * fs->fs_spc / NSPB(fs);
if (fs_postbl(fs, pos)[i] == -1) {
printf("pos = %d, i = %d, fs = %s\n",
kprintf("pos = %d, i = %d, fs = %s\n",
pos, i, fs->fs_fsmnt);
panic("ffs_alloccgblk: cyl groups corrupted");
}
@ -991,7 +991,7 @@ ffs_alloccgblk(fs, cgp, bpref)
break;
i += delta;
}
printf("pos = %d, i = %d, fs = %s\n", pos, i, fs->fs_fsmnt);
kprintf("pos = %d, i = %d, fs = %s\n", pos, i, fs->fs_fsmnt);
panic("ffs_alloccgblk: can't find blk in cyl");
}
norot:
@ -1170,7 +1170,7 @@ ffs_nodealloccg(ip, cg, ipref, mode)
start = 0;
loc = skpc(0xff, len, &cg_inosused(cgp)[0]);
if (loc == 0) {
printf("cg = %d, irotor = %d, fs = %s\n",
kprintf("cg = %d, irotor = %d, fs = %s\n",
cg, cgp->cg_irotor, fs->fs_fsmnt);
panic("ffs_nodealloccg: map corrupted");
/* NOTREACHED */
@ -1185,7 +1185,7 @@ ffs_nodealloccg(ip, cg, ipref, mode)
goto gotit;
}
}
printf("fs = %s\n", fs->fs_fsmnt);
kprintf("fs = %s\n", fs->fs_fsmnt);
panic("ffs_nodealloccg: block not in map");
/* NOTREACHED */
gotit:
@ -1224,13 +1224,13 @@ ffs_blkfree(ip, bno, size)
fs = ip->i_fs;
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%x, bsize = %d, size = %ld, fs = %s\n",
kprintf("dev = 0x%x, bsize = %d, size = %ld, fs = %s\n",
ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("blkfree: bad size");
}
cg = dtog(fs, bno);
if ((u_int)bno >= fs->fs_size) {
printf("bad block %d, ino %d\n", bno, ip->i_number);
kprintf("bad block %d, ino %d\n", bno, ip->i_number);
ffs_fserr(fs, ip->i_uid, "bad block");
return;
}
@ -1250,7 +1250,7 @@ ffs_blkfree(ip, bno, size)
if (size == fs->fs_bsize) {
blkno = fragstoblks(fs, bno);
if (ffs_isblock(fs, cg_blksfree(cgp), blkno)) {
printf("dev = 0x%x, block = %d, fs = %s\n",
kprintf("dev = 0x%x, block = %d, fs = %s\n",
ip->i_dev, bno, fs->fs_fsmnt);
panic("blkfree: freeing free block");
}
@ -1275,7 +1275,7 @@ ffs_blkfree(ip, bno, size)
frags = numfrags(fs, size);
for (i = 0; i < frags; i++) {
if (isset(cg_blksfree(cgp), bno + i)) {
printf("dev = 0x%x, block = %d, fs = %s\n",
kprintf("dev = 0x%x, block = %d, fs = %s\n",
ip->i_dev, bno + i, fs->fs_fsmnt);
panic("blkfree: freeing free frag");
}
@ -1351,7 +1351,7 @@ ffs_vfree(v)
cgp->cg_time = time.tv_sec;
ino %= fs->fs_ipg;
if (isclr(cg_inosused(cgp), ino)) {
printf("dev = 0x%x, ino = %d, fs = %s\n",
kprintf("dev = 0x%x, ino = %d, fs = %s\n",
pip->i_dev, ino, fs->fs_fsmnt);
if (fs->fs_ronly == 0)
panic("ifree: freeing free inode");
@ -1408,7 +1408,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
(u_char *)fragtbl[fs->fs_frag],
(u_char)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
if (loc == 0) {
printf("start = %d, len = %d, fs = %s\n",
kprintf("start = %d, len = %d, fs = %s\n",
start, len, fs->fs_fsmnt);
panic("ffs_alloccg: map corrupted");
/* NOTREACHED */
@ -1432,7 +1432,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
subfield <<= 1;
}
}
printf("bno = %d, fs = %s\n", bno, fs->fs_fsmnt);
kprintf("bno = %d, fs = %s\n", bno, fs->fs_fsmnt);
panic("ffs_alloccg: block not in map");
return (-1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_subr.c,v 1.7 1996/09/20 22:14:59 christos Exp $ */
/* $NetBSD: ffs_subr.c,v 1.8 1996/10/10 17:21:17 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -145,9 +145,9 @@ ffs_checkoverlap(bp, ip)
ep->b_blkno + btodb(ep->b_bcount) <= start)
continue;
vprint("Disk overlap", vp);
(void)printf("\tstart %d, end %d overlap start %d, end %ld\n",
start, last, ep->b_blkno,
ep->b_blkno + btodb(ep->b_bcount) - 1);
kprintf("\tstart %d, end %d overlap start %d, end %ld\n",
start, last, ep->b_blkno,
ep->b_blkno + btodb(ep->b_bcount) - 1);
panic("Disk buffer overlap");
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.20 1996/10/10 17:21:19 christos Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@ -272,7 +272,7 @@ ffs_mount(mp, path, data, ndp, p)
if (fs->fs_clean & FS_WASCLEAN)
fs->fs_time = time.tv_sec;
else
printf("%s: file system not clean; please fsck(8)\n",
kprintf("%s: file system not clean; please fsck(8)\n",
mp->mnt_stat.f_mntfromname);
(void) ffs_cgupdate(ump, MNT_WAIT);
}
@ -711,7 +711,7 @@ ffs_sync(mp, waitfor, cred, p)
*/
if (fs->fs_fmod != 0) {
if (fs->fs_ronly != 0) { /* XXX */
printf("fs = %s\n", fs->fs_fsmnt);
kprintf("fs = %s\n", fs->fs_fsmnt);
panic("update: rofs mod");
}
fs->fs_fmod = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_alloc.c,v 1.4 1996/03/25 12:53:37 pk Exp $ */
/* $NetBSD: lfs_alloc.c,v 1.5 1996/10/10 17:21:21 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -82,7 +82,7 @@ lfs_valloc(v)
fs = VTOI(ap->a_pvp)->i_lfs;
new_ino = fs->lfs_free;
#ifdef ALLOCPRINT
printf("lfs_ialloc: allocate inode %d\n", new_ino);
kprintf("lfs_ialloc: allocate inode %d\n", new_ino);
#endif
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_debug.c,v 1.4 1996/03/17 02:16:28 christos Exp $ */
/* $NetBSD: lfs_debug.c,v 1.5 1996/10/10 17:21:22 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -53,65 +53,65 @@ lfs_dump_super(lfsp)
{
int i;
(void)printf("%s%x\t%s%x\t%s%d\t%s%d\n",
kprintf("%s%x\t%s%x\t%s%d\t%s%d\n",
"magic ", lfsp->lfs_magic,
"version ", lfsp->lfs_version,
"size ", lfsp->lfs_size,
"ssize ", lfsp->lfs_ssize);
(void)printf("%s%d\t%s%d\t%s%d\t%s%d\n",
kprintf("%s%d\t%s%d\t%s%d\t%s%d\n",
"dsize ", lfsp->lfs_dsize,
"bsize ", lfsp->lfs_bsize,
"fsize ", lfsp->lfs_fsize,
"frag ", lfsp->lfs_frag);
(void)printf("%s%d\t%s%d\t%s%d\t%s%d\n",
kprintf("%s%d\t%s%d\t%s%d\t%s%d\n",
"minfree ", lfsp->lfs_minfree,
"inopb ", lfsp->lfs_inopb,
"ifpb ", lfsp->lfs_ifpb,
"nindir ", lfsp->lfs_nindir);
(void)printf("%s%d\t%s%d\t%s%d\t%s%d\n",
kprintf("%s%d\t%s%d\t%s%d\t%s%d\n",
"nseg ", lfsp->lfs_nseg,
"nspf ", lfsp->lfs_nspf,
"cleansz ", lfsp->lfs_cleansz,
"segtabsz ", lfsp->lfs_segtabsz);
(void)printf("%s%x\t%s%d\t%s%x\t%s%d\n",
kprintf("%s%x\t%s%d\t%s%x\t%s%d\n",
"segmask ", lfsp->lfs_segmask,
"segshift ", lfsp->lfs_segshift,
"bmask ", lfsp->lfs_bmask,
"bshift ", lfsp->lfs_bshift);
(void)printf("%s%x\t%s%d\t%s%x\t%s%d\n",
kprintf("%s%x\t%s%d\t%s%x\t%s%d\n",
"ffmask ", lfsp->lfs_ffmask,
"ffshift ", lfsp->lfs_ffshift,
"fbmask ", lfsp->lfs_fbmask,
"fbshift ", lfsp->lfs_fbshift);
(void)printf("%s%d\t%s%d\t%s%x\t%s%qx\n",
kprintf("%s%d\t%s%d\t%s%x\t%s%qx\n",
"sushift ", lfsp->lfs_sushift,
"fsbtodb ", lfsp->lfs_fsbtodb,
"cksum ", lfsp->lfs_cksum,
"maxfilesize ", lfsp->lfs_maxfilesize);
(void)printf("Superblock disk addresses:");
kprintf("Superblock disk addresses:");
for (i = 0; i < LFS_MAXNUMSB; i++)
(void)printf(" %x", lfsp->lfs_sboffs[i]);
(void)printf("\n");
kprintf(" %x", lfsp->lfs_sboffs[i]);
kprintf("\n");
(void)printf("Checkpoint Info\n");
(void)printf("%s%d\t%s%x\t%s%d\n",
kprintf("Checkpoint Info\n");
kprintf("%s%d\t%s%x\t%s%d\n",
"free ", lfsp->lfs_free,
"idaddr ", lfsp->lfs_idaddr,
"ifile ", lfsp->lfs_ifile);
(void)printf("%s%x\t%s%d\t%s%x\t%s%x\t%s%x\t%s%x\n",
kprintf("%s%x\t%s%d\t%s%x\t%s%x\t%s%x\t%s%x\n",
"bfree ", lfsp->lfs_bfree,
"nfiles ", lfsp->lfs_nfiles,
"lastseg ", lfsp->lfs_lastseg,
"nextseg ", lfsp->lfs_nextseg,
"curseg ", lfsp->lfs_curseg,
"offset ", lfsp->lfs_offset);
(void)printf("tstamp %x\n", lfsp->lfs_tstamp);
kprintf("tstamp %x\n", lfsp->lfs_tstamp);
}
void
@ -120,21 +120,21 @@ lfs_dump_dinode(dip)
{
int i;
(void)printf("%s%u\t%s%d\t%s%u\t%s%u\t%s%qu\n",
kprintf("%s%u\t%s%d\t%s%u\t%s%u\t%s%qu\n",
"mode ", dip->di_mode,
"nlink ", dip->di_nlink,
"uid ", dip->di_uid,
"gid ", dip->di_gid,
"size ", dip->di_size);
(void)printf("inum %d\n", dip->di_inumber);
(void)printf("Direct Addresses\n");
kprintf("inum %d\n", dip->di_inumber);
kprintf("Direct Addresses\n");
for (i = 0; i < NDADDR; i++) {
(void)printf("\t%x", dip->di_db[i]);
kprintf("\t%x", dip->di_db[i]);
if ((i % 6) == 5)
(void)printf("\n");
kprintf("\n");
}
for (i = 0; i < NIADDR; i++)
(void)printf("\t%x", dip->di_ib[i]);
(void)printf("\n");
kprintf("\t%x", dip->di_ib[i]);
kprintf("\n");
}
#endif /* DEBUG */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_inode.c,v 1.6 1996/09/01 23:49:27 mycroft Exp $ */
/* $NetBSD: lfs_inode.c,v 1.7 1996/10/10 17:21:24 christos Exp $ */
/*
* Copyright (c) 1986, 1989, 1991, 1993
@ -300,7 +300,7 @@ lfs_truncate(v)
#ifdef DIAGNOSTIC
if (ip->i_blocks < fsbtodb(fs, blocksreleased)) {
printf("lfs_truncate: block count < 0\n");
kprintf("lfs_truncate: block count < 0\n");
blocksreleased = ip->i_blocks;
}
#endif
@ -334,7 +334,7 @@ lfs_truncate(v)
blocksreleased = fsbtodb(fs, i_released);
#ifdef DIAGNOSTIC
if (blocksreleased > ip->i_blocks) {
printf("lfs_inode: Warning! %s\n",
kprintf("lfs_inode: Warning! %s\n",
"more blocks released from inode than are in inode");
blocksreleased = ip->i_blocks;
}
@ -343,7 +343,7 @@ lfs_truncate(v)
ip->i_blocks -= blocksreleased;
#ifdef DIAGNOSTIC
if (length == 0 && ip->i_blocks != 0)
printf("lfs_inode: Warning! %s%d%s\n",
kprintf("lfs_inode: Warning! %s%d%s\n",
"Truncation to zero, but ", ip->i_blocks,
" blocks left on inode");
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_segment.c,v 1.5 1996/09/01 23:49:29 mycroft Exp $ */
/* $NetBSD: lfs_segment.c,v 1.6 1996/10/10 17:21:25 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -230,7 +230,7 @@ lfs_segwrite(mp, flags)
clean = cip->clean;
brelse(bp);
if (clean <= 2) {
printf ("segs clean: %d\n", clean);
kprintf ("segs clean: %d\n", clean);
wakeup(&lfs_allclean_wakeup);
error = tsleep(&fs->lfs_avail, PRIBIO + 1,
"lfs writer", 0);
@ -452,7 +452,7 @@ lfs_writeinode(fs, sp, ip)
#ifdef DIAGNOSTIC
if (sup->su_nbytes < sizeof(struct dinode)) {
/* XXX -- Change to a panic. */
printf("lfs: negative bytes (segment %d)\n",
kprintf("lfs: negative bytes (segment %d)\n",
datosn(fs, daddr));
panic("negative bytes");
}
@ -603,7 +603,7 @@ lfs_updatemeta(sp)
* to get counted for the inode.
*/
if (bp->b_blkno == -1 && !(bp->b_flags & B_CACHE)) {
printf ("Updatemeta allocating indirect block: shouldn't happen\n");
kprintf ("Updatemeta allocating indirect block: shouldn't happen\n");
ip->i_blocks += btodb(fs->lfs_bsize);
fs->lfs_bfree -= btodb(fs->lfs_bsize);
}
@ -618,7 +618,7 @@ printf ("Updatemeta allocating indirect block: shouldn't happen\n");
#ifdef DIAGNOSTIC
if (sup->su_nbytes < fs->lfs_bsize) {
/* XXX -- Change to a panic. */
printf("lfs: negative bytes (segment %d)\n",
kprintf("lfs: negative bytes (segment %d)\n",
datosn(fs, daddr));
panic ("Negative Bytes");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_subr.c,v 1.3 1996/02/09 22:28:55 christos Exp $ */
/* $NetBSD: lfs_subr.c,v 1.4 1996/10/10 17:21:27 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -152,7 +152,7 @@ lfs_segunlock(fs)
free((*sp->bpp)->b_data, M_SEGMENT);
free(*sp->bpp, M_SEGMENT);
} else
printf ("unlock to 0 with no summary");
kprintf ("unlock to 0 with no summary");
free(sp->bpp, M_SEGMENT);
free(sp, M_SEGMENT);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_syscalls.c,v 1.10 1996/02/09 22:28:56 christos Exp $ */
/* $NetBSD: lfs_syscalls.c,v 1.11 1996/10/10 17:21:29 christos Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@ -177,7 +177,7 @@ lfs_markv(p, v, retval)
blkp->bi_lbn == LFS_UNUSED_LBN ?
blkp->bi_bp : NULL)) {
#ifdef DIAGNOSTIC
printf("lfs_markv: VFS_VGET failed (%d)\n",
kprintf("lfs_markv: VFS_VGET failed (%d)\n",
blkp->bi_inode);
#endif
lastino = LFS_UNUSED_INUM;
@ -472,10 +472,10 @@ lfs_fastvget(mp, ino, daddr, vpp, dinp)
if ((*vpp = ufs_ihashlookup(dev, ino)) != NULL) {
lfs_vref(*vpp);
if ((*vpp)->v_flag & VXLOCK)
printf ("Cleaned vnode VXLOCKED\n");
kprintf ("Cleaned vnode VXLOCKED\n");
ip = VTOI(*vpp);
if (ip->i_flag & IN_LOCKED)
printf("cleaned vnode locked\n");
kprintf("cleaned vnode locked\n");
if (!(ip->i_flag & IN_MODIFIED)) {
++ump->um_lfs->lfs_uinodes;
ip->i_flag |= IN_MODIFIED;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfs_vnops.c,v 1.10 1996/09/07 12:41:41 mycroft Exp $ */
/* $NetBSD: mfs_vnops.c,v 1.11 1996/10/10 17:21:31 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -273,7 +273,7 @@ mfs_close(v)
* vnode, so if we find any other uses, it is a panic.
*/
if (vp->v_usecount > 1)
printf("mfs_close: ref count %d > 1\n", vp->v_usecount);
kprintf("mfs_close: ref count %d > 1\n", vp->v_usecount);
if (vp->v_usecount > 1 || mfsp->mfs_buflist)
panic("mfs_close");
/*
@ -332,7 +332,7 @@ mfs_print(v)
} */ *ap = v;
register struct mfsnode *mfsp = VTOMFS(ap->a_vp);
printf("tag VT_MFS, pid %d, base %p, size %ld\n", mfsp->mfs_pid,
kprintf("tag VT_MFS, pid %d, base %p, size %ld\n", mfsp->mfs_pid,
mfsp->mfs_baseoff, mfsp->mfs_size);
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_lookup.c,v 1.7 1996/02/09 22:36:06 christos Exp $ */
/* $NetBSD: ufs_lookup.c,v 1.8 1996/10/10 17:21:33 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -616,7 +616,7 @@ ufs_dirbad(ip, offset, how)
struct mount *mp;
mp = ITOV(ip)->v_mount;
(void)printf("%s: bad dir ino %d at offset %d: %s\n",
kprintf("%s: bad dir ino %d at offset %d: %s\n",
mp->mnt_stat.f_mntonname, ip->i_number, offset, how);
if ((mp->mnt_stat.f_flags & MNT_RDONLY) == 0)
panic("bad dir");
@ -651,7 +651,7 @@ ufs_dirbadentry(dp, ep, entryoffsetinblock)
ep->d_reclen > DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1)) ||
ep->d_reclen < DIRSIZ(FSFMT(dp), ep) || namlen > MAXNAMLEN) {
/*return (1); */
printf("First bad\n");
kprintf("First bad\n");
goto bad;
}
if (ep->d_ino == 0)
@ -659,7 +659,7 @@ ufs_dirbadentry(dp, ep, entryoffsetinblock)
for (i = 0; i < namlen; i++)
if (ep->d_name[i] == '\0') {
/*return (1); */
printf("Second bad\n");
kprintf("Second bad\n");
goto bad;
}
if (ep->d_name[i])
@ -1054,7 +1054,7 @@ ufs_checkpath(source, target, cred)
out:
if (error == ENOTDIR)
printf("checkpath: .. not a directory\n");
kprintf("checkpath: .. not a directory\n");
if (vp != NULL)
vput(vp);
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_vnops.c,v 1.19 1996/09/01 23:49:43 mycroft Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.20 1996/10/10 17:21:36 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -1541,7 +1541,7 @@ start:
if (ip->i_lockholder != 0)
panic("lockholder (%d) != 0", ip->i_lockholder);
if (p && p->p_pid == 0)
printf("locking by process 0\n");
kprintf("locking by process 0\n");
if (p)
ip->i_lockholder = p->p_pid;
else
@ -1656,19 +1656,19 @@ ufs_print(v)
register struct vnode *vp = ap->a_vp;
register struct inode *ip = VTOI(vp);
printf("tag VT_UFS, ino %d, on dev %d, %d", ip->i_number,
major(ip->i_dev), minor(ip->i_dev));
kprintf("tag VT_UFS, ino %d, on dev %d, %d", ip->i_number,
major(ip->i_dev), minor(ip->i_dev));
#ifdef FIFO
if (vp->v_type == VFIFO)
fifo_printinfo(vp);
#endif /* FIFO */
printf("%s\n", (ip->i_flag & IN_LOCKED) ? " (LOCKED)" : "");
kprintf("%s\n", (ip->i_flag & IN_LOCKED) ? " (LOCKED)" : "");
if (ip->i_lockholder == 0)
return (0);
printf("\towner pid %d", ip->i_lockholder);
kprintf("\towner pid %d", ip->i_lockholder);
if (ip->i_lockwaiter)
printf(" waiting pid %d", ip->i_lockwaiter);
printf("\n");
kprintf(" waiting pid %d", ip->i_lockwaiter);
kprintf("\n");
return (0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: device_pager.c,v 1.21 1996/03/16 23:15:18 christos Exp $ */
/* $NetBSD: device_pager.c,v 1.22 1996/10/10 17:16:17 christos Exp $ */
/*
* Copyright (c) 1990 University of Utah.
@ -93,7 +93,7 @@ dev_pager_init()
{
#ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_init()\n");
kprintf("dev_pager_init()\n");
#endif
TAILQ_INIT(&dev_pager_list);
TAILQ_INIT(&dev_pager_fakelist);
@ -115,8 +115,8 @@ dev_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_alloc(%p, %lx, %x, %lx)\n",
handle, size, prot, foff);
kprintf("dev_pager_alloc(%p, %lx, %x, %lx)\n",
handle, size, prot, foff);
#endif
#ifdef DIAGNOSTIC
/*
@ -196,8 +196,8 @@ top:
TAILQ_INSERT_TAIL(&dev_pager_list, pager, pg_list);
#ifdef DEBUG
if (dpagerdebug & DDB_ALLOC) {
printf("dev_pager_alloc: pager %p devp %p object %p\n",
pager, devp, object);
kprintf("dev_pager_alloc: pager %p devp %p object %p\n",
pager, devp, object);
vm_object_print(object, FALSE);
}
#endif
@ -226,7 +226,7 @@ dev_pager_dealloc(pager)
#ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_dealloc(%p)\n", pager);
kprintf("dev_pager_dealloc(%p)\n", pager);
#endif
TAILQ_REMOVE(&dev_pager_list, pager, pg_list);
/*
@ -238,7 +238,7 @@ dev_pager_dealloc(pager)
object = devp->devp_object;
#ifdef DEBUG
if (dpagerdebug & DDB_ALLOC)
printf("dev_pager_dealloc: devp %p object %p\n", devp, object);
kprintf("dev_pager_dealloc: devp %p object %p\n", devp, object);
#endif
/*
* Free up our fake pages.
@ -267,7 +267,7 @@ dev_pager_getpage(pager, mlist, npages, sync)
#ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_getpage(%p, %p, %x, %x)\n",
kprintf("dev_pager_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
@ -320,8 +320,8 @@ dev_pager_putpage(pager, mlist, npages, sync)
{
#ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
kprintf("dev_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
if (pager == NULL)
return (FALSE);
@ -335,7 +335,7 @@ dev_pager_haspage(pager, offset)
{
#ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_haspage(%p, %lx)\n", pager, offset);
kprintf("dev_pager_haspage(%p, %lx)\n", pager, offset);
#endif
return(TRUE);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: swap_pager.c,v 1.27 1996/03/16 23:15:20 christos Exp $ */
/* $NetBSD: swap_pager.c,v 1.28 1996/10/10 17:16:19 christos Exp $ */
/*
* Copyright (c) 1990 University of Utah.
@ -165,7 +165,7 @@ swap_pager_init()
#ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_INIT))
printf("swpg_init()\n");
kprintf("swpg_init()\n");
#endif
dfltpagerops = &swappagerops;
TAILQ_INIT(&swap_pager_list);
@ -217,7 +217,7 @@ swap_pager_init()
swap_pager_maxcluster = dbtob(bsize);
#ifdef DEBUG
if (swpagerdebug & SDB_INIT)
printf("swpg_init: ix %d, size %lx, bsize %x\n",
kprintf("swpg_init: ix %d, size %lx, bsize %x\n",
i, swtab[i].st_osize, swtab[i].st_bsize);
#endif
if (bsize >= maxbsize)
@ -247,7 +247,7 @@ swap_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOC))
printf("swpg_alloc(%p, %lx, %x)\n", handle, size, prot);
kprintf("swpg_alloc(%p, %lx, %x)\n", handle, size, prot);
#endif
/*
* If this is a "named" anonymous region, look it up and
@ -278,7 +278,7 @@ swap_pager_alloc(handle, size, prot, foff)
if (swp == NULL) {
#ifdef DEBUG
if (swpagerdebug & SDB_FAIL)
printf("swpg_alloc: swpager malloc failed\n");
kprintf("swpg_alloc: swpager malloc failed\n");
#endif
free((caddr_t)pager, M_VMPAGER);
return(NULL);
@ -302,7 +302,7 @@ swap_pager_alloc(handle, size, prot, foff)
free((caddr_t)pager, M_VMPAGER);
#ifdef DEBUG
if (swpagerdebug & SDB_FAIL)
printf("swpg_alloc: sw_blocks malloc failed\n");
kprintf("swpg_alloc: sw_blocks malloc failed\n");
swt->st_inuse--;
swt->st_usecnt--;
#endif
@ -337,8 +337,8 @@ swap_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG
if (swpagerdebug & SDB_ALLOC)
printf("swpg_alloc: pg_data %p, %x of %x at %p\n",
swp, swp->sw_nblocks, swp->sw_bsize, swp->sw_blocks);
kprintf("swpg_alloc: pg_data %p, %x of %x at %p\n",
swp, swp->sw_nblocks, swp->sw_bsize, swp->sw_blocks);
#endif
return(pager);
}
@ -357,7 +357,7 @@ swap_pager_dealloc(pager)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return;
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOC))
printf("swpg_dealloc(%p)\n", pager);
kprintf("swpg_dealloc(%p)\n", pager);
#endif
/*
* Remove from list right away so lookups will fail if we
@ -394,7 +394,7 @@ swap_pager_dealloc(pager)
if (bp->swb_block) {
#ifdef DEBUG
if (swpagerdebug & (SDB_ALLOCBLK|SDB_FULL))
printf("swpg_dealloc: blk %x\n",
kprintf("swpg_dealloc: blk %x\n",
bp->swb_block);
#endif
rmfree(swapmap, swp->sw_bsize, bp->swb_block);
@ -422,8 +422,8 @@ swap_pager_getpage(pager, mlist, npages, sync)
#ifdef DEBUG
if (swpagerdebug & SDB_FOLLOW)
printf("swpg_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
kprintf("swpg_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
#ifdef DIAGNOSTIC
for (i = 0; i < npages; i++) {
@ -456,8 +456,8 @@ swap_pager_putpage(pager, mlist, npages, sync)
#ifdef DEBUG
if (swpagerdebug & SDB_FOLLOW)
printf("swpg_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
kprintf("swpg_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
if (pager == NULL) {
swap_pager_clean(B_WRITE);
@ -481,15 +481,15 @@ swap_pager_haspage(pager, offset)
#ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOCBLK))
printf("swpg_haspage(%p, %lx) ", pager, offset);
kprintf("swpg_haspage(%p, %lx) ", pager, offset);
#endif
swp = (sw_pager_t) pager->pg_data;
ix = offset / dbtob(swp->sw_bsize);
if (swp->sw_blocks == NULL || ix >= swp->sw_nblocks) {
#ifdef DEBUG
if (swpagerdebug & (SDB_FAIL|SDB_FOLLOW|SDB_ALLOCBLK))
printf("swpg_haspage: %p bad offset %lx, ix %x\n",
swp->sw_blocks, offset, ix);
kprintf("swpg_haspage: %p bad offset %lx, ix %x\n",
swp->sw_blocks, offset, ix);
#endif
return(FALSE);
}
@ -498,10 +498,10 @@ swap_pager_haspage(pager, offset)
ix = atop(offset % dbtob(swp->sw_bsize));
#ifdef DEBUG
if (swpagerdebug & SDB_ALLOCBLK)
printf("%p blk %x+%x ", swp->sw_blocks, swb->swb_block, ix);
kprintf("%p blk %x+%x ", swp->sw_blocks, swb->swb_block, ix);
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOCBLK))
printf("-> %c\n",
"FT"[swb->swb_block && (swb->swb_mask & (1 << ix))]);
kprintf("-> %c\n",
"FT"[swb->swb_block && (swb->swb_mask & (1 << ix))]);
#endif
if (swb->swb_block && (swb->swb_mask & (1 << ix)))
return(TRUE);
@ -521,7 +521,7 @@ swap_pager_cluster(pager, offset, loffset, hoffset)
#ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_CLUSTER))
printf("swpg_cluster(%p, %lx) ", pager, offset);
kprintf("swpg_cluster(%p, %lx) ", pager, offset);
#endif
swp = (sw_pager_t) pager->pg_data;
bsize = dbtob(swp->sw_bsize);
@ -540,7 +540,7 @@ swap_pager_cluster(pager, offset, loffset, hoffset)
*hoffset = hoff;
#ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_CLUSTER))
printf("returns [%lx-%lx]\n", loff, hoff);
kprintf("returns [%lx-%lx]\n", loff, hoff);
#endif
}
@ -571,7 +571,7 @@ swap_pager_io(swp, mlist, npages, flags)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return (VM_PAGER_FAIL); /* XXX: correct return? */
if (swpagerdebug & (SDB_FOLLOW|SDB_IO))
printf("swpg_io(%p, %p, %x, %x)\n", swp, mlist, npages, flags);
kprintf("swpg_io(%p, %p, %x, %x)\n", swp, mlist, npages, flags);
if (flags & B_READ) {
if (flags & B_ASYNC)
panic("swap_pager_io: cannot do ASYNC reads");
@ -592,7 +592,7 @@ swap_pager_io(swp, mlist, npages, flags)
if (swp->sw_blocks == NULL || ix >= swp->sw_nblocks) {
#ifdef DEBUG
if ((flags & B_READ) == 0 && (swpagerdebug & SDB_ANOM)) {
printf("swap_pager_io: no swap block on write\n");
kprintf("swap_pager_io: no swap block on write\n");
return(VM_PAGER_BAD);
}
#endif
@ -632,8 +632,8 @@ swap_pager_io(swp, mlist, npages, flags)
if (swap_pager_free.tqh_first == NULL) {
#ifdef DEBUG
if (swpagerdebug & SDB_FAIL)
printf("%s: no available io headers\n",
"swap_pager_io");
kprintf("%s: no available io headers\n",
"swap_pager_io");
#endif
return(VM_PAGER_AGAIN);
}
@ -647,8 +647,8 @@ swap_pager_io(swp, mlist, npages, flags)
if (swb->swb_block == 0) {
#ifdef DEBUG
if (swpagerdebug & SDB_FAIL)
printf("swpg_io: rmalloc of %x failed\n",
swp->sw_bsize);
kprintf("swpg_io: rmalloc of %x failed\n",
swp->sw_bsize);
#endif
/*
* XXX this is technically a resource shortage that
@ -661,8 +661,8 @@ swap_pager_io(swp, mlist, npages, flags)
}
#ifdef DEBUG
if (swpagerdebug & (SDB_FULL|SDB_ALLOCBLK))
printf("swpg_io: %p alloc blk %x at ix %x\n",
swp->sw_blocks, swb->swb_block, ix);
kprintf("swpg_io: %p alloc blk %x at ix %x\n",
swp->sw_blocks, swb->swb_block, ix);
#endif
}
@ -674,8 +674,8 @@ swap_pager_io(swp, mlist, npages, flags)
if (kva == NULL) {
#ifdef DEBUG
if (swpagerdebug & SDB_FAIL)
printf("%s: no KVA space to map pages\n",
"swap_pager_io");
kprintf("%s: no KVA space to map pages\n",
"swap_pager_io");
#endif
return(VM_PAGER_AGAIN);
}
@ -687,8 +687,8 @@ swap_pager_io(swp, mlist, npages, flags)
while (bswlist.b_actf == NULL) {
#ifdef DEBUG
if (swpagerdebug & SDB_IO) /* XXX what should this be? */
printf("swap_pager_io: wait on swbuf for %p (%d)\n",
m, flags);
kprintf("swap_pager_io: wait on swbuf for %p (%d)\n",
m, flags);
#endif
bswlist.b_flags |= B_WANTED;
tsleep((caddr_t)&bswlist, PSWP+1, "swpgiobuf", 0);
@ -721,16 +721,16 @@ swap_pager_io(swp, mlist, npages, flags)
#ifdef DEBUG
swap_pager_poip++;
if (swpagerdebug & SDB_WRITE)
printf("swpg_io: write: bp=%p swp=%p poip=%d\n",
bp, swp, swp->sw_poip);
kprintf("swpg_io: write: bp=%p swp=%p poip=%d\n",
bp, swp, swp->sw_poip);
if ((swpagerdebug & SDB_ALLOCBLK) &&
(swb->swb_mask & mask) != mask)
printf("swpg_io: %p write %d pages at %x+%lx\n",
swp->sw_blocks, npages, swb->swb_block,
atop(off));
kprintf("swpg_io: %p write %d pages at %x+%lx\n",
swp->sw_blocks, npages, swb->swb_block,
atop(off));
if (swpagerdebug & SDB_CLUSTER)
printf("swpg_io: off=%lx, npg=%x, mask=%x, bmask=%x\n",
off, npages, mask, swb->swb_mask);
kprintf("swpg_io: off=%lx, npg=%x, mask=%x, bmask=%x\n",
off, npages, mask, swb->swb_mask);
#endif
swb->swb_mask |= mask;
}
@ -775,14 +775,14 @@ swap_pager_io(swp, mlist, npages, flags)
*/
#ifdef DEBUG
if (swpagerdebug & SDB_IO)
printf("swpg_io: IO start: bp %p, db %lx, va %lx, pa %lx\n",
bp, swb->swb_block+btodb(off), kva, VM_PAGE_TO_PHYS(m));
kprintf("swpg_io: IO start: bp %p, db %lx, va %lx, pa %lx\n",
bp, swb->swb_block+btodb(off), kva, VM_PAGE_TO_PHYS(m));
#endif
VOP_STRATEGY(bp);
if ((flags & (B_READ|B_ASYNC)) == B_ASYNC) {
#ifdef DEBUG
if (swpagerdebug & SDB_IO)
printf("swpg_io: IO started: bp %p\n", bp);
kprintf("swpg_io: IO started: bp %p\n", bp);
#endif
return(VM_PAGER_PEND);
}
@ -820,9 +820,9 @@ swap_pager_io(swp, mlist, npages, flags)
splx(s);
#ifdef DEBUG
if (swpagerdebug & SDB_IO)
printf("swpg_io: IO done: bp %p, rv %d\n", bp, rv);
kprintf("swpg_io: IO done: bp %p, rv %d\n", bp, rv);
if ((swpagerdebug & SDB_FAIL) && rv == VM_PAGER_ERROR)
printf("swpg_io: IO error\n");
kprintf("swpg_io: IO error\n");
#endif
vm_pager_unmap_pages(kva, npages);
return(rv);
@ -842,7 +842,7 @@ swap_pager_clean(rw)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return;
if (swpagerdebug & SDB_FOLLOW)
printf("swpg_clean(%x)\n", rw);
kprintf("swpg_clean(%x)\n", rw);
#endif
for (;;) {
@ -900,9 +900,8 @@ swap_pager_clean(rw)
* after awhile.
*/
if (spc->spc_flags & SPC_ERROR) {
printf("%s: clean of page %lx failed\n",
"swap_pager_clean",
VM_PAGE_TO_PHYS(m));
kprintf("%s: clean of page %lx failed\n",
"swap_pager_clean", VM_PAGE_TO_PHYS(m));
m->flags |= PG_LAUNDRY;
} else {
m->flags |= PG_CLEAN;
@ -928,7 +927,7 @@ swap_pager_clean(rw)
TAILQ_INSERT_TAIL(&swap_pager_free, spc, spc_list);
#ifdef DEBUG
if (swpagerdebug & SDB_WRITE)
printf("swpg_clean: free spc %p\n", spc);
kprintf("swpg_clean: free spc %p\n", spc);
#endif
}
}
@ -958,7 +957,7 @@ swap_pager_clean_check(mlist, npages, rw)
for (i = 0; i < npages; i++)
if (m == mlist[i]) {
if (swpagerdebug & SDB_ANOM)
printf(
kprintf(
"swpg_clean_check: %s: page %p on list, flags %x\n",
rw == B_WRITE ? "write" : "read", mlist[i], spc->spc_flags);
bad = TRUE;
@ -984,7 +983,7 @@ swap_pager_iodone(bp)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return;
if (swpagerdebug & SDB_FOLLOW)
printf("swpg_iodone(%p)\n", bp);
kprintf("swpg_iodone(%p)\n", bp);
#endif
s = splbio();
for (spc = swap_pager_inuse.tqh_first;
@ -1007,9 +1006,9 @@ swap_pager_iodone(bp)
#ifdef DEBUG
--swap_pager_poip;
if (swpagerdebug & SDB_WRITE)
printf("swpg_iodone: bp=%p swp=%p flags=%x spc=%p poip=%x\n",
bp, spc->spc_swp, spc->spc_swp->sw_flags,
spc, spc->spc_swp->sw_poip);
kprintf("swpg_iodone: bp=%p swp=%p flags=%x spc=%p poip=%x\n",
bp, spc->spc_swp, spc->spc_swp->sw_flags,
spc, spc->spc_swp->sw_poip);
#endif
spc->spc_swp->sw_poip--;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_glue.c,v 1.57 1996/10/02 18:05:10 ws Exp $ */
/* $NetBSD: vm_glue.c,v 1.58 1996/10/10 17:16:20 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -389,7 +389,7 @@ loop:
}
#ifdef DEBUG
if (swapdebug & SDB_FOLLOW)
printf("scheduler: running, procp %p pri %d\n", pp, ppri);
kprintf("scheduler: running, procp %p pri %d\n", pp, ppri);
#endif
/*
* Nothing to do, back to sleep
@ -407,9 +407,9 @@ loop:
if (cnt.v_free_count > atop(USPACE)) {
#ifdef DEBUG
if (swapdebug & SDB_SWAPIN)
printf("swapin: pid %d(%s)@%p, pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr,
ppri, cnt.v_free_count);
kprintf("swapin: pid %d(%s)@%p, pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr,
ppri, cnt.v_free_count);
#endif
swapin(p);
goto loop;
@ -420,15 +420,15 @@ loop:
*/
#ifdef DEBUG
if (swapdebug & SDB_FOLLOW)
printf("scheduler: no room for pid %d(%s), free %d\n",
p->p_pid, p->p_comm, cnt.v_free_count);
kprintf("scheduler: no room for pid %d(%s), free %d\n",
p->p_pid, p->p_comm, cnt.v_free_count);
#endif
(void) splhigh();
VM_WAIT;
(void) spl0();
#ifdef DEBUG
if (swapdebug & SDB_FOLLOW)
printf("scheduler: room again, free %d\n", cnt.v_free_count);
kprintf("scheduler: room again, free %d\n", cnt.v_free_count);
#endif
goto loop;
}
@ -495,7 +495,7 @@ swapout_threads()
p = outp2;
#ifdef DEBUG
if (swapdebug & SDB_SWAPOUT)
printf("swapout_threads: no duds, try procp %p\n", p);
kprintf("swapout_threads: no duds, try procp %p\n", p);
#endif
if (p)
swapout(p);
@ -511,9 +511,9 @@ swapout(p)
#ifdef DEBUG
if (swapdebug & SDB_SWAPOUT)
printf("swapout: pid %d(%s)@%p, stat %x pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr, p->p_stat,
p->p_slptime, cnt.v_free_count);
kprintf("swapout: pid %d(%s)@%p, stat %x pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr, p->p_stat,
p->p_slptime, cnt.v_free_count);
#endif
/*
@ -607,20 +607,27 @@ void
#if __STDC__
iprintf(void (*pr)(const char *, ...), const char *fmt, ...)
#else
iprintf(pr, fmt /* , va_alist */)
void (*pr)();
char *fmt;
/* va_dcl */
iprintf(va_alist)
va_dcl
#endif
{
register int i;
va_list ap;
#if __STDC__
va_start(ap, fmt);
#else
void (*pr) __P((const char *, ...));
const char *fmt;
va_start(ap);
pr = va_arg(ap, void (*) __P((const char *, ...)));
fmt = va_arg(ap, const char *);
#endif
for (i = indent; i >= 8; i -= 8)
(*pr)("\t");
while (--i >= 0)
(*pr)(" ");
va_start(ap, fmt);
(*pr)("%:", fmt, ap);
va_end(ap);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_kern.c,v 1.18 1996/06/13 16:52:06 cgd Exp $ */
/* $NetBSD: vm_kern.c,v 1.19 1996/10/10 17:16:21 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -242,7 +242,7 @@ kmem_suballoc(parent, min, max, size, pageable)
ret = vm_map_find(parent, NULL, (vm_offset_t) 0,
min, size, TRUE);
if (ret != KERN_SUCCESS) {
printf("kmem_suballoc: bad status return of %d.\n", ret);
kprintf("kmem_suballoc: bad status return of %d.\n", ret);
panic("kmem_suballoc");
}
*max = *min + size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_map.c,v 1.23 1996/02/10 00:08:08 christos Exp $ */
/* $NetBSD: vm_map.c,v 1.24 1996/10/10 17:16:22 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -1686,7 +1686,7 @@ vm_map_copy_entry(src_map, dst_map, src_entry, dst_entry)
if (dst_entry->object.vm_object != NULL &&
(dst_entry->object.vm_object->flags & OBJ_INTERNAL) == 0)
printf("vm_map_copy_entry: copying over permanent data!\n");
kprintf("vm_map_copy_entry: copying over permanent data!\n");
/*
* If our destination map was wired down,
@ -2237,7 +2237,7 @@ vmspace_fork(vm1)
old_entry->offset,
FALSE, FALSE);
if (check != KERN_SUCCESS)
printf("vm_map_fork: copy in share_map region failed\n");
kprintf("vm_map_fork: copy in share_map region failed\n");
}
else {
vm_map_copy_entry(old_map, new_map, old_entry,
@ -2581,7 +2581,7 @@ vm_map_print(map, full)
register vm_map_t map;
boolean_t full;
{
_vm_map_print(map, full, printf);
_vm_map_print(map, full, kprintf);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_mmap.c,v 1.47 1996/03/16 23:15:23 christos Exp $ */
/* $NetBSD: vm_mmap.c,v 1.48 1996/10/10 17:16:23 christos Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -149,7 +149,7 @@ sys_mmap(p, v, retval)
#ifdef DEBUG
if (mmapdebug & MDB_FOLLOW)
printf("mmap(%d): addr %lx len %lx pro %x flg %x fd %d pos %lx\n",
kprintf("mmap(%d): addr %lx len %lx pro %x flg %x fd %d pos %lx\n",
p->p_pid, addr, size, prot, flags, fd, pos);
#endif
@ -283,8 +283,8 @@ sys_msync(p, v, retval)
size = (vm_size_t)SCARG(uap, len);
#ifdef DEBUG
if (mmapdebug & (MDB_FOLLOW|MDB_SYNC))
printf("msync(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
kprintf("msync(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
#endif
/*
@ -322,8 +322,8 @@ sys_msync(p, v, retval)
}
#ifdef DEBUG
if (mmapdebug & MDB_SYNC)
printf("msync: cleaning/flushing address range [%lx-%lx)\n",
addr, addr+size);
kprintf("msync: cleaning/flushing address range [%lx-%lx)\n",
addr, addr+size);
#endif
/*
* Could pass this in as a third flag argument to implement
@ -373,8 +373,8 @@ sys_munmap(p, v, retval)
size = (vm_size_t) SCARG(uap, len);
#ifdef DEBUG
if (mmapdebug & MDB_FOLLOW)
printf("munmap(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
kprintf("munmap(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
#endif
/*
@ -417,7 +417,7 @@ munmapfd(p, fd)
{
#ifdef DEBUG
if (mmapdebug & MDB_FOLLOW)
printf("munmapfd(%d): fd %d\n", p->p_pid, fd);
kprintf("munmapfd(%d): fd %d\n", p->p_pid, fd);
#endif
/*
@ -446,7 +446,7 @@ sys_mprotect(p, v, retval)
prot = SCARG(uap, prot) & VM_PROT_ALL;
#ifdef DEBUG
if (mmapdebug & MDB_FOLLOW)
printf("mprotect(%d): addr %lx len %lx prot %d\n", p->p_pid,
kprintf("mprotect(%d): addr %lx len %lx prot %d\n", p->p_pid,
addr, size, prot);
#endif
/*
@ -527,8 +527,8 @@ sys_mlock(p, v, retval)
size = (vm_size_t)SCARG(uap, len);
#ifdef DEBUG
if (mmapdebug & MDB_FOLLOW)
printf("mlock(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
kprintf("mlock(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
#endif
/*
* Align the address to a page boundary,
@ -576,8 +576,8 @@ sys_munlock(p, v, retval)
size = (vm_size_t)SCARG(uap, len);
#ifdef DEBUG
if (mmapdebug & MDB_FOLLOW)
printf("munlock(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
kprintf("munlock(%d): addr %lx len %lx\n",
p->p_pid, addr, size);
#endif
/*
* Align the address to a page boundary,
@ -695,8 +695,8 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
(void) pager_cache(object, FALSE);
#ifdef DEBUG
if (mmapdebug & MDB_MAPIT)
printf("vm_mmap(%d): ANON *addr %lx size %lx pager %p\n",
curproc->p_pid, *addr, size, pager);
kprintf("vm_mmap(%d): ANON *addr %lx size %lx pager %p\n",
curproc->p_pid, *addr, size, pager);
#endif
}
/*
@ -725,8 +725,8 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
else {
#ifdef DEBUG
if (object == NULL)
printf("vm_mmap: no object: vp %p, pager %p\n",
vp, pager);
kprintf("vm_mmap: no object: vp %p, pager %p\n",
vp, pager);
#endif
/*
* Map it directly.
@ -807,10 +807,10 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
PMAP_PREFER(foff, &paddr);
#endif
if (paddr != *addr)
printf(
"vm_mmap: pmap botch! "
"[foff %lx, addr %lx, paddr %lx]\n",
foff, *addr, paddr);
kprintf(
"vm_mmap: pmap botch! "
"[foff %lx, addr %lx, paddr %lx]\n",
foff, *addr, paddr);
}
#endif
}
@ -880,8 +880,8 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
}
#ifdef DEBUG
if (mmapdebug & MDB_MAPIT)
printf("vm_mmap(%d): FILE *addr %lx size %lx pager %p\n",
curproc->p_pid, *addr, size, pager);
kprintf("vm_mmap(%d): FILE *addr %lx size %lx pager %p\n",
curproc->p_pid, *addr, size, pager);
#endif
}
/*
@ -910,7 +910,7 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
out:
#ifdef DEBUG
if (mmapdebug & MDB_MAPIT)
printf("vm_mmap: rv %d\n", rv);
kprintf("vm_mmap: rv %d\n", rv);
#endif
switch (rv) {
case KERN_SUCCESS:

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_object.c,v 1.34 1996/02/28 22:35:35 gwr Exp $ */
/* $NetBSD: vm_object.c,v 1.35 1996/10/10 17:16:24 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -476,8 +476,8 @@ again:
* Will loose changes to the page.
*/
if (vm_pager_put(object->pager, p, syncio)) {
printf("%s: pager_put error\n",
"vm_object_page_clean");
kprintf("%s: pager_put error\n",
"vm_object_page_clean");
p->flags |= PG_CLEAN;
noerror = FALSE;
}
@ -1410,7 +1410,7 @@ vm_object_print(object, full)
vm_object_t object;
boolean_t full;
{
_vm_object_print(object, full, printf);
_vm_object_print(object, full, kprintf);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_pager.c,v 1.21 1996/03/16 23:15:25 christos Exp $ */
/* $NetBSD: vm_pager.c,v 1.22 1996/10/10 17:16:25 christos Exp $ */
/*
* Copyright (c) 1991, 1993
@ -340,8 +340,8 @@ vm_pager_unmap_pages(kva, npages)
if (m->flags & PG_PAGEROWNED)
m->flags &= ~PG_PAGEROWNED;
else
printf("vm_pager_unmap_pages: %p(%lx/%lx) not owned\n",
m, va, VM_PAGE_TO_PHYS(m));
kprintf("vm_pager_unmap_pages: %p(%lx/%lx) not owned\n",
m, va, VM_PAGE_TO_PHYS(m));
}
#endif
pmap_remove(vm_map_pmap(pager_map), kva, kva + size);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_swap.c,v 1.32 1996/02/05 01:54:09 christos Exp $ */
/* $NetBSD: vm_swap.c,v 1.33 1996/10/10 17:16:26 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -143,11 +143,11 @@ swapinit()
panic("swapvp");
#endif
if (nswap == 0)
printf("WARNING: no swap space found\n");
kprintf("WARNING: no swap space found\n");
else if ((error = swfree(p, 0)) == ENXIO)
printf("WARNING: primary swap device not configured\n");
kprintf("WARNING: primary swap device not configured\n");
else if (error) {
printf("swfree errno %d\n", error); /* XXX */
kprintf("swfree errno %d\n", error); /* XXX */
panic("swapinit swfree 0");
}
@ -480,8 +480,8 @@ swfree(p, index)
firstblk = rmalloc(swapmap, rootblks - ctod(CLSIZE));
if (firstblk != ctod(CLSIZE))
panic("swfree miniroot save");
printf("Preserved %d blocks of miniroot leaving %d pages of swap\n",
rootblks, dtoc(nblks - rootblks));
kprintf("Preserved %d blocks of miniroot leaving %d pages of swap\n",
rootblks, dtoc(nblks - rootblks));
}
return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vnode_pager.c,v 1.19 1996/03/16 23:15:27 christos Exp $ */
/* $NetBSD: vnode_pager.c,v 1.20 1996/10/10 17:16:26 christos Exp $ */
/*
* Copyright (c) 1990 University of Utah.
@ -103,7 +103,7 @@ vnode_pager_init()
{
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_init()\n");
kprintf("vnode_pager_init()\n");
#endif
TAILQ_INIT(&vnode_pager_list);
}
@ -128,7 +128,7 @@ vnode_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG
if (vpagerdebug & (VDB_FOLLOW|VDB_ALLOC))
printf("vnode_pager_alloc(%p, %lx, %x)\n", handle, size, prot);
kprintf("vnode_pager_alloc(%p, %lx, %x)\n", handle, size, prot);
#endif
/*
* Pageout to vnode, no can do yet.
@ -192,8 +192,8 @@ vnode_pager_alloc(handle, size, prot, foff)
}
#ifdef DEBUG
if (vpagerdebug & VDB_ALLOC)
printf("vnode_pager_setup: vp %p sz %lx pager %p object %p\n",
vp, vnp->vnp_size, pager, object);
kprintf("vnode_pager_setup: vp %p sz %lx pager %p object %p\n",
vp, vnp->vnp_size, pager, object);
#endif
return(pager);
}
@ -210,7 +210,7 @@ vnode_pager_dealloc(pager)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_dealloc(%p)\n", pager);
kprintf("vnode_pager_dealloc(%p)\n", pager);
#endif
if ((vp = vnp->vnp_vp) != NULL) {
vp->v_vmdata = NULL;
@ -236,8 +236,8 @@ vnode_pager_getpage(pager, mlist, npages, sync)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
kprintf("vnode_pager_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
return(vnode_pager_io((vn_pager_t)pager->pg_data,
mlist, npages, sync, UIO_READ));
@ -254,8 +254,8 @@ vnode_pager_putpage(pager, mlist, npages, sync)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
kprintf("vnode_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync);
#endif
if (pager == NULL)
return (FALSE); /* ??? */
@ -285,7 +285,7 @@ vnode_pager_haspage(pager, offset)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_haspage(%p, %lx)\n", pager, offset);
kprintf("vnode_pager_haspage(%p, %lx)\n", pager, offset);
#endif
/*
@ -298,7 +298,7 @@ vnode_pager_haspage(pager, offset)
VOP_UNLOCK(vnp->vnp_vp);
#ifdef DEBUG
if (vpagerdebug & (VDB_FAIL|VDB_SIZE))
printf("vnode_pager_haspage: pg %p, off %lx, size %lx\n",
kprintf("vnode_pager_haspage: pg %p, off %lx, size %lx\n",
pager, offset, vnp->vnp_size);
#endif
return(FALSE);
@ -318,7 +318,7 @@ vnode_pager_haspage(pager, offset)
if (err) {
#ifdef DEBUG
if (vpagerdebug & VDB_FAIL)
printf("vnode_pager_haspage: BMAP err %d, pg %p, off %lx\n",
kprintf("vnode_pager_haspage: BMAP err %d, pg %p, off %lx\n",
err, pager, offset);
#endif
return(TRUE);
@ -338,7 +338,7 @@ vnode_pager_cluster(pager, offset, loffset, hoffset)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_cluster(%p, %lx) ", pager, offset);
kprintf("vnode_pager_cluster(%p, %lx) ", pager, offset);
#endif
loff = offset;
if (loff >= vnp->vnp_size)
@ -354,7 +354,7 @@ vnode_pager_cluster(pager, offset, loffset, hoffset)
*hoffset = hoff;
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("returns [%lx-%lx]\n", loff, hoff);
kprintf("returns [%lx-%lx]\n", loff, hoff);
#endif
}
@ -403,8 +403,8 @@ vnode_pager_setsize(vp, nsize)
#ifdef DEBUG
if (vpagerdebug & (VDB_FOLLOW|VDB_SIZE))
printf("vnode_pager_setsize: vp %p obj %p osz %ld nsz %ld\n",
vp, object, vnp->vnp_size, nsize);
kprintf("vnode_pager_setsize: vp %p obj %p osz %ld nsz %ld\n",
vp, object, vnp->vnp_size, nsize);
#endif
/*
* File has shrunk.
@ -522,8 +522,8 @@ vnode_pager_io(vnp, mlist, npages, sync, rw)
#ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_io(%p, %p, %c): vnode %p\n",
vnp, m, rw == UIO_READ ? 'R' : 'W', vnp->vnp_vp);
kprintf("vnode_pager_io(%p, %p, %c): vnode %p\n",
vnp, m, rw == UIO_READ ? 'R' : 'W', vnp->vnp_vp);
#endif
foff = m->offset + m->object->paging_offset;
/*
@ -545,8 +545,8 @@ vnode_pager_io(vnp, mlist, npages, sync, rw)
vm_pager_unmap_pages(kva, npages);
#ifdef DEBUG
if (vpagerdebug & VDB_SIZE)
printf("vnode_pager_io: vp %p, off %ld size %ld\n",
vnp->vnp_vp, foff, vnp->vnp_size);
kprintf("vnode_pager_io: vp %p, off %ld size %ld\n",
vnp->vnp_vp, foff, vnp->vnp_size);
#endif
return(VM_PAGER_BAD);
}
@ -565,8 +565,8 @@ vnode_pager_io(vnp, mlist, npages, sync, rw)
auio.uio_procp = (struct proc *)0;
#ifdef DEBUG
if (vpagerdebug & VDB_IO)
printf("vnode_pager_io: vp %p kva %lx foff %lx size %x",
vnp->vnp_vp, kva, foff, size);
kprintf("vnode_pager_io: vp %p kva %lx foff %lx size %x",
vnp->vnp_vp, kva, foff, size);
#endif
if (rw == UIO_READ)
error = VOP_READ(vnp->vnp_vp, &auio, 0, p->p_ucred);
@ -576,9 +576,9 @@ vnode_pager_io(vnp, mlist, npages, sync, rw)
#ifdef DEBUG
if (vpagerdebug & VDB_IO) {
if (error || auio.uio_resid)
printf(" returns error %x, resid %x",
error, auio.uio_resid);
printf("\n");
kprintf(" returns error %x, resid %x",
error, auio.uio_resid);
kprintf("\n");
}
#endif
if (!error) {