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 * Copyright (c) 1982, 1986, 1989, 1993
@ -105,7 +105,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp)
fs = ip->i_fs; fs = ip->i_fs;
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { 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); ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("ffs_alloc: bad size"); panic("ffs_alloc: bad size");
} }
@ -173,7 +173,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 || if ((u_int)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(u_int)nsize > fs->fs_bsize || fragoff(fs, nsize) != 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", "dev = 0x%x, bsize = %d, osize = %d, nsize = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt); ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size"); 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) if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace; goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) { 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); ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev"); panic("ffs_realloccg: bad bprev");
} }
@ -259,7 +259,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
fs->fs_optim = FS_OPTSPACE; fs->fs_optim = FS_OPTSPACE;
break; break;
default: 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); ip->i_dev, fs->fs_optim, fs->fs_fsmnt);
panic("ffs_realloccg: bad optim"); panic("ffs_realloccg: bad optim");
/* NOTREACHED */ /* NOTREACHED */
@ -414,7 +414,7 @@ ffs_reallocblks(v)
*/ */
#ifdef DEBUG #ifdef DEBUG
if (prtrealloc) 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); start_lbn, end_lbn);
#endif #endif
blkno = newblk; blkno = newblk;
@ -427,7 +427,7 @@ ffs_reallocblks(v)
#endif #endif
#ifdef DEBUG #ifdef DEBUG
if (prtrealloc) if (prtrealloc)
printf(" %d,", *bap); kprintf(" %d,", *bap);
#endif #endif
*bap++ = blkno; *bap++ = blkno;
} }
@ -467,7 +467,7 @@ ffs_reallocblks(v)
*/ */
#ifdef DEBUG #ifdef DEBUG
if (prtrealloc) if (prtrealloc)
printf("\n\tnew:"); kprintf("\n\tnew:");
#endif #endif
for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) { for (blkno = newblk, i = 0; i < len; i++, blkno += fs->fs_frag) {
ffs_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), 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); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
#ifdef DEBUG #ifdef DEBUG
if (prtrealloc) if (prtrealloc)
printf(" %d,", blkno); kprintf(" %d,", blkno);
#endif #endif
} }
#ifdef DEBUG #ifdef DEBUG
if (prtrealloc) { if (prtrealloc) {
prtrealloc--; prtrealloc--;
printf("\n"); kprintf("\n");
} }
#endif #endif
return (0); return (0);
@ -550,12 +550,12 @@ ffs_valloc(v)
} }
ip = VTOI(*ap->a_vpp); ip = VTOI(*ap->a_vpp);
if (ip->i_mode) { 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); ip->i_mode, ip->i_number, fs->fs_fsmnt);
panic("ffs_valloc: dup alloc"); panic("ffs_valloc: dup alloc");
} }
if (ip->i_blocks) { /* XXX */ 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); fs->fs_fsmnt, ino, ip->i_blocks);
ip->i_blocks = 0; ip->i_blocks = 0;
} }
@ -976,7 +976,7 @@ ffs_alloccgblk(fs, cgp, bpref)
pos = cylno % fs->fs_cpc; pos = cylno % fs->fs_cpc;
bno = (cylno - pos) * fs->fs_spc / NSPB(fs); bno = (cylno - pos) * fs->fs_spc / NSPB(fs);
if (fs_postbl(fs, pos)[i] == -1) { 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); pos, i, fs->fs_fsmnt);
panic("ffs_alloccgblk: cyl groups corrupted"); panic("ffs_alloccgblk: cyl groups corrupted");
} }
@ -991,7 +991,7 @@ ffs_alloccgblk(fs, cgp, bpref)
break; break;
i += delta; 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"); panic("ffs_alloccgblk: can't find blk in cyl");
} }
norot: norot:
@ -1170,7 +1170,7 @@ ffs_nodealloccg(ip, cg, ipref, mode)
start = 0; start = 0;
loc = skpc(0xff, len, &cg_inosused(cgp)[0]); loc = skpc(0xff, len, &cg_inosused(cgp)[0]);
if (loc == 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); cg, cgp->cg_irotor, fs->fs_fsmnt);
panic("ffs_nodealloccg: map corrupted"); panic("ffs_nodealloccg: map corrupted");
/* NOTREACHED */ /* NOTREACHED */
@ -1185,7 +1185,7 @@ ffs_nodealloccg(ip, cg, ipref, mode)
goto gotit; goto gotit;
} }
} }
printf("fs = %s\n", fs->fs_fsmnt); kprintf("fs = %s\n", fs->fs_fsmnt);
panic("ffs_nodealloccg: block not in map"); panic("ffs_nodealloccg: block not in map");
/* NOTREACHED */ /* NOTREACHED */
gotit: gotit:
@ -1224,13 +1224,13 @@ ffs_blkfree(ip, bno, size)
fs = ip->i_fs; fs = ip->i_fs;
if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { 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); ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("blkfree: bad size"); panic("blkfree: bad size");
} }
cg = dtog(fs, bno); cg = dtog(fs, bno);
if ((u_int)bno >= fs->fs_size) { 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"); ffs_fserr(fs, ip->i_uid, "bad block");
return; return;
} }
@ -1250,7 +1250,7 @@ ffs_blkfree(ip, bno, size)
if (size == fs->fs_bsize) { if (size == fs->fs_bsize) {
blkno = fragstoblks(fs, bno); blkno = fragstoblks(fs, bno);
if (ffs_isblock(fs, cg_blksfree(cgp), blkno)) { 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); ip->i_dev, bno, fs->fs_fsmnt);
panic("blkfree: freeing free block"); panic("blkfree: freeing free block");
} }
@ -1275,7 +1275,7 @@ ffs_blkfree(ip, bno, size)
frags = numfrags(fs, size); frags = numfrags(fs, size);
for (i = 0; i < frags; i++) { for (i = 0; i < frags; i++) {
if (isset(cg_blksfree(cgp), bno + 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); ip->i_dev, bno + i, fs->fs_fsmnt);
panic("blkfree: freeing free frag"); panic("blkfree: freeing free frag");
} }
@ -1351,7 +1351,7 @@ ffs_vfree(v)
cgp->cg_time = time.tv_sec; cgp->cg_time = time.tv_sec;
ino %= fs->fs_ipg; ino %= fs->fs_ipg;
if (isclr(cg_inosused(cgp), ino)) { 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); pip->i_dev, ino, fs->fs_fsmnt);
if (fs->fs_ronly == 0) if (fs->fs_ronly == 0)
panic("ifree: freeing free inode"); panic("ifree: freeing free inode");
@ -1408,7 +1408,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
(u_char *)fragtbl[fs->fs_frag], (u_char *)fragtbl[fs->fs_frag],
(u_char)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY)))); (u_char)(1 << (allocsiz - 1 + (fs->fs_frag % NBBY))));
if (loc == 0) { if (loc == 0) {
printf("start = %d, len = %d, fs = %s\n", kprintf("start = %d, len = %d, fs = %s\n",
start, len, fs->fs_fsmnt); start, len, fs->fs_fsmnt);
panic("ffs_alloccg: map corrupted"); panic("ffs_alloccg: map corrupted");
/* NOTREACHED */ /* NOTREACHED */
@ -1432,7 +1432,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz)
subfield <<= 1; 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"); panic("ffs_alloccg: block not in map");
return (-1); 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 * Copyright (c) 1982, 1986, 1989, 1993
@ -145,9 +145,9 @@ ffs_checkoverlap(bp, ip)
ep->b_blkno + btodb(ep->b_bcount) <= start) ep->b_blkno + btodb(ep->b_bcount) <= start)
continue; continue;
vprint("Disk overlap", vp); vprint("Disk overlap", vp);
(void)printf("\tstart %d, end %d overlap start %d, end %ld\n", kprintf("\tstart %d, end %d overlap start %d, end %ld\n",
start, last, ep->b_blkno, start, last, ep->b_blkno,
ep->b_blkno + btodb(ep->b_bcount) - 1); ep->b_blkno + btodb(ep->b_bcount) - 1);
panic("Disk buffer overlap"); 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 * Copyright (c) 1989, 1991, 1993, 1994
@ -272,7 +272,7 @@ ffs_mount(mp, path, data, ndp, p)
if (fs->fs_clean & FS_WASCLEAN) if (fs->fs_clean & FS_WASCLEAN)
fs->fs_time = time.tv_sec; fs->fs_time = time.tv_sec;
else 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); mp->mnt_stat.f_mntfromname);
(void) ffs_cgupdate(ump, MNT_WAIT); (void) ffs_cgupdate(ump, MNT_WAIT);
} }
@ -711,7 +711,7 @@ ffs_sync(mp, waitfor, cred, p)
*/ */
if (fs->fs_fmod != 0) { if (fs->fs_fmod != 0) {
if (fs->fs_ronly != 0) { /* XXX */ if (fs->fs_ronly != 0) { /* XXX */
printf("fs = %s\n", fs->fs_fsmnt); kprintf("fs = %s\n", fs->fs_fsmnt);
panic("update: rofs mod"); panic("update: rofs mod");
} }
fs->fs_fmod = 0; 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 * Copyright (c) 1991, 1993
@ -82,7 +82,7 @@ lfs_valloc(v)
fs = VTOI(ap->a_pvp)->i_lfs; fs = VTOI(ap->a_pvp)->i_lfs;
new_ino = fs->lfs_free; new_ino = fs->lfs_free;
#ifdef ALLOCPRINT #ifdef ALLOCPRINT
printf("lfs_ialloc: allocate inode %d\n", new_ino); kprintf("lfs_ialloc: allocate inode %d\n", new_ino);
#endif #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 * Copyright (c) 1991, 1993
@ -53,65 +53,65 @@ lfs_dump_super(lfsp)
{ {
int i; 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, "magic ", lfsp->lfs_magic,
"version ", lfsp->lfs_version, "version ", lfsp->lfs_version,
"size ", lfsp->lfs_size, "size ", lfsp->lfs_size,
"ssize ", lfsp->lfs_ssize); "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, "dsize ", lfsp->lfs_dsize,
"bsize ", lfsp->lfs_bsize, "bsize ", lfsp->lfs_bsize,
"fsize ", lfsp->lfs_fsize, "fsize ", lfsp->lfs_fsize,
"frag ", lfsp->lfs_frag); "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, "minfree ", lfsp->lfs_minfree,
"inopb ", lfsp->lfs_inopb, "inopb ", lfsp->lfs_inopb,
"ifpb ", lfsp->lfs_ifpb, "ifpb ", lfsp->lfs_ifpb,
"nindir ", lfsp->lfs_nindir); "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, "nseg ", lfsp->lfs_nseg,
"nspf ", lfsp->lfs_nspf, "nspf ", lfsp->lfs_nspf,
"cleansz ", lfsp->lfs_cleansz, "cleansz ", lfsp->lfs_cleansz,
"segtabsz ", lfsp->lfs_segtabsz); "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, "segmask ", lfsp->lfs_segmask,
"segshift ", lfsp->lfs_segshift, "segshift ", lfsp->lfs_segshift,
"bmask ", lfsp->lfs_bmask, "bmask ", lfsp->lfs_bmask,
"bshift ", lfsp->lfs_bshift); "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, "ffmask ", lfsp->lfs_ffmask,
"ffshift ", lfsp->lfs_ffshift, "ffshift ", lfsp->lfs_ffshift,
"fbmask ", lfsp->lfs_fbmask, "fbmask ", lfsp->lfs_fbmask,
"fbshift ", lfsp->lfs_fbshift); "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, "sushift ", lfsp->lfs_sushift,
"fsbtodb ", lfsp->lfs_fsbtodb, "fsbtodb ", lfsp->lfs_fsbtodb,
"cksum ", lfsp->lfs_cksum, "cksum ", lfsp->lfs_cksum,
"maxfilesize ", lfsp->lfs_maxfilesize); "maxfilesize ", lfsp->lfs_maxfilesize);
(void)printf("Superblock disk addresses:"); kprintf("Superblock disk addresses:");
for (i = 0; i < LFS_MAXNUMSB; i++) for (i = 0; i < LFS_MAXNUMSB; i++)
(void)printf(" %x", lfsp->lfs_sboffs[i]); kprintf(" %x", lfsp->lfs_sboffs[i]);
(void)printf("\n"); kprintf("\n");
(void)printf("Checkpoint Info\n"); kprintf("Checkpoint Info\n");
(void)printf("%s%d\t%s%x\t%s%d\n", kprintf("%s%d\t%s%x\t%s%d\n",
"free ", lfsp->lfs_free, "free ", lfsp->lfs_free,
"idaddr ", lfsp->lfs_idaddr, "idaddr ", lfsp->lfs_idaddr,
"ifile ", lfsp->lfs_ifile); "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, "bfree ", lfsp->lfs_bfree,
"nfiles ", lfsp->lfs_nfiles, "nfiles ", lfsp->lfs_nfiles,
"lastseg ", lfsp->lfs_lastseg, "lastseg ", lfsp->lfs_lastseg,
"nextseg ", lfsp->lfs_nextseg, "nextseg ", lfsp->lfs_nextseg,
"curseg ", lfsp->lfs_curseg, "curseg ", lfsp->lfs_curseg,
"offset ", lfsp->lfs_offset); "offset ", lfsp->lfs_offset);
(void)printf("tstamp %x\n", lfsp->lfs_tstamp); kprintf("tstamp %x\n", lfsp->lfs_tstamp);
} }
void void
@ -120,21 +120,21 @@ lfs_dump_dinode(dip)
{ {
int i; 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, "mode ", dip->di_mode,
"nlink ", dip->di_nlink, "nlink ", dip->di_nlink,
"uid ", dip->di_uid, "uid ", dip->di_uid,
"gid ", dip->di_gid, "gid ", dip->di_gid,
"size ", dip->di_size); "size ", dip->di_size);
(void)printf("inum %d\n", dip->di_inumber); kprintf("inum %d\n", dip->di_inumber);
(void)printf("Direct Addresses\n"); kprintf("Direct Addresses\n");
for (i = 0; i < NDADDR; i++) { 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) if ((i % 6) == 5)
(void)printf("\n"); kprintf("\n");
} }
for (i = 0; i < NIADDR; i++) for (i = 0; i < NIADDR; i++)
(void)printf("\t%x", dip->di_ib[i]); kprintf("\t%x", dip->di_ib[i]);
(void)printf("\n"); kprintf("\n");
} }
#endif /* DEBUG */ #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 * Copyright (c) 1986, 1989, 1991, 1993
@ -300,7 +300,7 @@ lfs_truncate(v)
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (ip->i_blocks < fsbtodb(fs, blocksreleased)) { 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; blocksreleased = ip->i_blocks;
} }
#endif #endif
@ -334,7 +334,7 @@ lfs_truncate(v)
blocksreleased = fsbtodb(fs, i_released); blocksreleased = fsbtodb(fs, i_released);
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (blocksreleased > ip->i_blocks) { 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"); "more blocks released from inode than are in inode");
blocksreleased = ip->i_blocks; blocksreleased = ip->i_blocks;
} }
@ -343,7 +343,7 @@ lfs_truncate(v)
ip->i_blocks -= blocksreleased; ip->i_blocks -= blocksreleased;
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (length == 0 && ip->i_blocks != 0) 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, "Truncation to zero, but ", ip->i_blocks,
" blocks left on inode"); " blocks left on inode");
#endif #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 * Copyright (c) 1991, 1993
@ -230,7 +230,7 @@ lfs_segwrite(mp, flags)
clean = cip->clean; clean = cip->clean;
brelse(bp); brelse(bp);
if (clean <= 2) { if (clean <= 2) {
printf ("segs clean: %d\n", clean); kprintf ("segs clean: %d\n", clean);
wakeup(&lfs_allclean_wakeup); wakeup(&lfs_allclean_wakeup);
error = tsleep(&fs->lfs_avail, PRIBIO + 1, error = tsleep(&fs->lfs_avail, PRIBIO + 1,
"lfs writer", 0); "lfs writer", 0);
@ -452,7 +452,7 @@ lfs_writeinode(fs, sp, ip)
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
if (sup->su_nbytes < sizeof(struct dinode)) { if (sup->su_nbytes < sizeof(struct dinode)) {
/* XXX -- Change to a panic. */ /* XXX -- Change to a panic. */
printf("lfs: negative bytes (segment %d)\n", kprintf("lfs: negative bytes (segment %d)\n",
datosn(fs, daddr)); datosn(fs, daddr));
panic("negative bytes"); panic("negative bytes");
} }
@ -603,7 +603,7 @@ lfs_updatemeta(sp)
* to get counted for the inode. * to get counted for the inode.
*/ */
if (bp->b_blkno == -1 && !(bp->b_flags & B_CACHE)) { 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); ip->i_blocks += btodb(fs->lfs_bsize);
fs->lfs_bfree -= 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 #ifdef DIAGNOSTIC
if (sup->su_nbytes < fs->lfs_bsize) { if (sup->su_nbytes < fs->lfs_bsize) {
/* XXX -- Change to a panic. */ /* XXX -- Change to a panic. */
printf("lfs: negative bytes (segment %d)\n", kprintf("lfs: negative bytes (segment %d)\n",
datosn(fs, daddr)); datosn(fs, daddr));
panic ("Negative Bytes"); 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 * Copyright (c) 1991, 1993
@ -152,7 +152,7 @@ lfs_segunlock(fs)
free((*sp->bpp)->b_data, M_SEGMENT); free((*sp->bpp)->b_data, M_SEGMENT);
free(*sp->bpp, M_SEGMENT); free(*sp->bpp, M_SEGMENT);
} else } else
printf ("unlock to 0 with no summary"); kprintf ("unlock to 0 with no summary");
free(sp->bpp, M_SEGMENT); free(sp->bpp, M_SEGMENT);
free(sp, 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 * Copyright (c) 1991, 1993, 1994
@ -177,7 +177,7 @@ lfs_markv(p, v, retval)
blkp->bi_lbn == LFS_UNUSED_LBN ? blkp->bi_lbn == LFS_UNUSED_LBN ?
blkp->bi_bp : NULL)) { blkp->bi_bp : NULL)) {
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
printf("lfs_markv: VFS_VGET failed (%d)\n", kprintf("lfs_markv: VFS_VGET failed (%d)\n",
blkp->bi_inode); blkp->bi_inode);
#endif #endif
lastino = LFS_UNUSED_INUM; lastino = LFS_UNUSED_INUM;
@ -472,10 +472,10 @@ lfs_fastvget(mp, ino, daddr, vpp, dinp)
if ((*vpp = ufs_ihashlookup(dev, ino)) != NULL) { if ((*vpp = ufs_ihashlookup(dev, ino)) != NULL) {
lfs_vref(*vpp); lfs_vref(*vpp);
if ((*vpp)->v_flag & VXLOCK) if ((*vpp)->v_flag & VXLOCK)
printf ("Cleaned vnode VXLOCKED\n"); kprintf ("Cleaned vnode VXLOCKED\n");
ip = VTOI(*vpp); ip = VTOI(*vpp);
if (ip->i_flag & IN_LOCKED) if (ip->i_flag & IN_LOCKED)
printf("cleaned vnode locked\n"); kprintf("cleaned vnode locked\n");
if (!(ip->i_flag & IN_MODIFIED)) { if (!(ip->i_flag & IN_MODIFIED)) {
++ump->um_lfs->lfs_uinodes; ++ump->um_lfs->lfs_uinodes;
ip->i_flag |= IN_MODIFIED; 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 * Copyright (c) 1989, 1993
@ -273,7 +273,7 @@ mfs_close(v)
* vnode, so if we find any other uses, it is a panic. * vnode, so if we find any other uses, it is a panic.
*/ */
if (vp->v_usecount > 1) 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) if (vp->v_usecount > 1 || mfsp->mfs_buflist)
panic("mfs_close"); panic("mfs_close");
/* /*
@ -332,7 +332,7 @@ mfs_print(v)
} */ *ap = v; } */ *ap = v;
register struct mfsnode *mfsp = VTOMFS(ap->a_vp); 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); mfsp->mfs_baseoff, mfsp->mfs_size);
return (0); 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 * Copyright (c) 1989, 1993
@ -616,7 +616,7 @@ ufs_dirbad(ip, offset, how)
struct mount *mp; struct mount *mp;
mp = ITOV(ip)->v_mount; 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); mp->mnt_stat.f_mntonname, ip->i_number, offset, how);
if ((mp->mnt_stat.f_flags & MNT_RDONLY) == 0) if ((mp->mnt_stat.f_flags & MNT_RDONLY) == 0)
panic("bad dir"); panic("bad dir");
@ -651,7 +651,7 @@ ufs_dirbadentry(dp, ep, entryoffsetinblock)
ep->d_reclen > DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1)) || ep->d_reclen > DIRBLKSIZ - (entryoffsetinblock & (DIRBLKSIZ - 1)) ||
ep->d_reclen < DIRSIZ(FSFMT(dp), ep) || namlen > MAXNAMLEN) { ep->d_reclen < DIRSIZ(FSFMT(dp), ep) || namlen > MAXNAMLEN) {
/*return (1); */ /*return (1); */
printf("First bad\n"); kprintf("First bad\n");
goto bad; goto bad;
} }
if (ep->d_ino == 0) if (ep->d_ino == 0)
@ -659,7 +659,7 @@ ufs_dirbadentry(dp, ep, entryoffsetinblock)
for (i = 0; i < namlen; i++) for (i = 0; i < namlen; i++)
if (ep->d_name[i] == '\0') { if (ep->d_name[i] == '\0') {
/*return (1); */ /*return (1); */
printf("Second bad\n"); kprintf("Second bad\n");
goto bad; goto bad;
} }
if (ep->d_name[i]) if (ep->d_name[i])
@ -1054,7 +1054,7 @@ ufs_checkpath(source, target, cred)
out: out:
if (error == ENOTDIR) if (error == ENOTDIR)
printf("checkpath: .. not a directory\n"); kprintf("checkpath: .. not a directory\n");
if (vp != NULL) if (vp != NULL)
vput(vp); vput(vp);
return (error); 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 * Copyright (c) 1982, 1986, 1989, 1993
@ -1541,7 +1541,7 @@ start:
if (ip->i_lockholder != 0) if (ip->i_lockholder != 0)
panic("lockholder (%d) != 0", ip->i_lockholder); panic("lockholder (%d) != 0", ip->i_lockholder);
if (p && p->p_pid == 0) if (p && p->p_pid == 0)
printf("locking by process 0\n"); kprintf("locking by process 0\n");
if (p) if (p)
ip->i_lockholder = p->p_pid; ip->i_lockholder = p->p_pid;
else else
@ -1656,19 +1656,19 @@ ufs_print(v)
register struct vnode *vp = ap->a_vp; register struct vnode *vp = ap->a_vp;
register struct inode *ip = VTOI(vp); register struct inode *ip = VTOI(vp);
printf("tag VT_UFS, ino %d, on dev %d, %d", ip->i_number, kprintf("tag VT_UFS, ino %d, on dev %d, %d", ip->i_number,
major(ip->i_dev), minor(ip->i_dev)); major(ip->i_dev), minor(ip->i_dev));
#ifdef FIFO #ifdef FIFO
if (vp->v_type == VFIFO) if (vp->v_type == VFIFO)
fifo_printinfo(vp); fifo_printinfo(vp);
#endif /* FIFO */ #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) if (ip->i_lockholder == 0)
return (0); return (0);
printf("\towner pid %d", ip->i_lockholder); kprintf("\towner pid %d", ip->i_lockholder);
if (ip->i_lockwaiter) if (ip->i_lockwaiter)
printf(" waiting pid %d", ip->i_lockwaiter); kprintf(" waiting pid %d", ip->i_lockwaiter);
printf("\n"); kprintf("\n");
return (0); 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. * Copyright (c) 1990 University of Utah.
@ -93,7 +93,7 @@ dev_pager_init()
{ {
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW) if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_init()\n"); kprintf("dev_pager_init()\n");
#endif #endif
TAILQ_INIT(&dev_pager_list); TAILQ_INIT(&dev_pager_list);
TAILQ_INIT(&dev_pager_fakelist); TAILQ_INIT(&dev_pager_fakelist);
@ -115,8 +115,8 @@ dev_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW) if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_alloc(%p, %lx, %x, %lx)\n", kprintf("dev_pager_alloc(%p, %lx, %x, %lx)\n",
handle, size, prot, foff); handle, size, prot, foff);
#endif #endif
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
/* /*
@ -196,8 +196,8 @@ top:
TAILQ_INSERT_TAIL(&dev_pager_list, pager, pg_list); TAILQ_INSERT_TAIL(&dev_pager_list, pager, pg_list);
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_ALLOC) { if (dpagerdebug & DDB_ALLOC) {
printf("dev_pager_alloc: pager %p devp %p object %p\n", kprintf("dev_pager_alloc: pager %p devp %p object %p\n",
pager, devp, object); pager, devp, object);
vm_object_print(object, FALSE); vm_object_print(object, FALSE);
} }
#endif #endif
@ -226,7 +226,7 @@ dev_pager_dealloc(pager)
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW) if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_dealloc(%p)\n", pager); kprintf("dev_pager_dealloc(%p)\n", pager);
#endif #endif
TAILQ_REMOVE(&dev_pager_list, pager, pg_list); TAILQ_REMOVE(&dev_pager_list, pager, pg_list);
/* /*
@ -238,7 +238,7 @@ dev_pager_dealloc(pager)
object = devp->devp_object; object = devp->devp_object;
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_ALLOC) 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 #endif
/* /*
* Free up our fake pages. * Free up our fake pages.
@ -267,7 +267,7 @@ dev_pager_getpage(pager, mlist, npages, sync)
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW) 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); pager, mlist, npages, sync);
#endif #endif
@ -320,8 +320,8 @@ dev_pager_putpage(pager, mlist, npages, sync)
{ {
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW) if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_putpage(%p, %p, %x, %x)\n", kprintf("dev_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync); pager, mlist, npages, sync);
#endif #endif
if (pager == NULL) if (pager == NULL)
return (FALSE); return (FALSE);
@ -335,7 +335,7 @@ dev_pager_haspage(pager, offset)
{ {
#ifdef DEBUG #ifdef DEBUG
if (dpagerdebug & DDB_FOLLOW) if (dpagerdebug & DDB_FOLLOW)
printf("dev_pager_haspage(%p, %lx)\n", pager, offset); kprintf("dev_pager_haspage(%p, %lx)\n", pager, offset);
#endif #endif
return(TRUE); 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. * Copyright (c) 1990 University of Utah.
@ -165,7 +165,7 @@ swap_pager_init()
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_INIT)) if (swpagerdebug & (SDB_FOLLOW|SDB_INIT))
printf("swpg_init()\n"); kprintf("swpg_init()\n");
#endif #endif
dfltpagerops = &swappagerops; dfltpagerops = &swappagerops;
TAILQ_INIT(&swap_pager_list); TAILQ_INIT(&swap_pager_list);
@ -217,7 +217,7 @@ swap_pager_init()
swap_pager_maxcluster = dbtob(bsize); swap_pager_maxcluster = dbtob(bsize);
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_INIT) 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); i, swtab[i].st_osize, swtab[i].st_bsize);
#endif #endif
if (bsize >= maxbsize) if (bsize >= maxbsize)
@ -247,7 +247,7 @@ swap_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOC)) 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 #endif
/* /*
* If this is a "named" anonymous region, look it up and * 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) { if (swp == NULL) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FAIL) if (swpagerdebug & SDB_FAIL)
printf("swpg_alloc: swpager malloc failed\n"); kprintf("swpg_alloc: swpager malloc failed\n");
#endif #endif
free((caddr_t)pager, M_VMPAGER); free((caddr_t)pager, M_VMPAGER);
return(NULL); return(NULL);
@ -302,7 +302,7 @@ swap_pager_alloc(handle, size, prot, foff)
free((caddr_t)pager, M_VMPAGER); free((caddr_t)pager, M_VMPAGER);
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FAIL) 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_inuse--;
swt->st_usecnt--; swt->st_usecnt--;
#endif #endif
@ -337,8 +337,8 @@ swap_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_ALLOC) if (swpagerdebug & SDB_ALLOC)
printf("swpg_alloc: pg_data %p, %x of %x at %p\n", kprintf("swpg_alloc: pg_data %p, %x of %x at %p\n",
swp, swp->sw_nblocks, swp->sw_bsize, swp->sw_blocks); swp, swp->sw_nblocks, swp->sw_bsize, swp->sw_blocks);
#endif #endif
return(pager); return(pager);
} }
@ -357,7 +357,7 @@ swap_pager_dealloc(pager)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr) if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return; return;
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOC)) if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOC))
printf("swpg_dealloc(%p)\n", pager); kprintf("swpg_dealloc(%p)\n", pager);
#endif #endif
/* /*
* Remove from list right away so lookups will fail if we * Remove from list right away so lookups will fail if we
@ -394,7 +394,7 @@ swap_pager_dealloc(pager)
if (bp->swb_block) { if (bp->swb_block) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_ALLOCBLK|SDB_FULL)) if (swpagerdebug & (SDB_ALLOCBLK|SDB_FULL))
printf("swpg_dealloc: blk %x\n", kprintf("swpg_dealloc: blk %x\n",
bp->swb_block); bp->swb_block);
#endif #endif
rmfree(swapmap, swp->sw_bsize, bp->swb_block); rmfree(swapmap, swp->sw_bsize, bp->swb_block);
@ -422,8 +422,8 @@ swap_pager_getpage(pager, mlist, npages, sync)
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FOLLOW) if (swpagerdebug & SDB_FOLLOW)
printf("swpg_getpage(%p, %p, %x, %x)\n", kprintf("swpg_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync); pager, mlist, npages, sync);
#endif #endif
#ifdef DIAGNOSTIC #ifdef DIAGNOSTIC
for (i = 0; i < npages; i++) { for (i = 0; i < npages; i++) {
@ -456,8 +456,8 @@ swap_pager_putpage(pager, mlist, npages, sync)
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FOLLOW) if (swpagerdebug & SDB_FOLLOW)
printf("swpg_putpage(%p, %p, %x, %x)\n", kprintf("swpg_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync); pager, mlist, npages, sync);
#endif #endif
if (pager == NULL) { if (pager == NULL) {
swap_pager_clean(B_WRITE); swap_pager_clean(B_WRITE);
@ -481,15 +481,15 @@ swap_pager_haspage(pager, offset)
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOCBLK)) if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOCBLK))
printf("swpg_haspage(%p, %lx) ", pager, offset); kprintf("swpg_haspage(%p, %lx) ", pager, offset);
#endif #endif
swp = (sw_pager_t) pager->pg_data; swp = (sw_pager_t) pager->pg_data;
ix = offset / dbtob(swp->sw_bsize); ix = offset / dbtob(swp->sw_bsize);
if (swp->sw_blocks == NULL || ix >= swp->sw_nblocks) { if (swp->sw_blocks == NULL || ix >= swp->sw_nblocks) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FAIL|SDB_FOLLOW|SDB_ALLOCBLK)) if (swpagerdebug & (SDB_FAIL|SDB_FOLLOW|SDB_ALLOCBLK))
printf("swpg_haspage: %p bad offset %lx, ix %x\n", kprintf("swpg_haspage: %p bad offset %lx, ix %x\n",
swp->sw_blocks, offset, ix); swp->sw_blocks, offset, ix);
#endif #endif
return(FALSE); return(FALSE);
} }
@ -498,10 +498,10 @@ swap_pager_haspage(pager, offset)
ix = atop(offset % dbtob(swp->sw_bsize)); ix = atop(offset % dbtob(swp->sw_bsize));
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_ALLOCBLK) 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)) if (swpagerdebug & (SDB_FOLLOW|SDB_ALLOCBLK))
printf("-> %c\n", kprintf("-> %c\n",
"FT"[swb->swb_block && (swb->swb_mask & (1 << ix))]); "FT"[swb->swb_block && (swb->swb_mask & (1 << ix))]);
#endif #endif
if (swb->swb_block && (swb->swb_mask & (1 << ix))) if (swb->swb_block && (swb->swb_mask & (1 << ix)))
return(TRUE); return(TRUE);
@ -521,7 +521,7 @@ swap_pager_cluster(pager, offset, loffset, hoffset)
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_CLUSTER)) if (swpagerdebug & (SDB_FOLLOW|SDB_CLUSTER))
printf("swpg_cluster(%p, %lx) ", pager, offset); kprintf("swpg_cluster(%p, %lx) ", pager, offset);
#endif #endif
swp = (sw_pager_t) pager->pg_data; swp = (sw_pager_t) pager->pg_data;
bsize = dbtob(swp->sw_bsize); bsize = dbtob(swp->sw_bsize);
@ -540,7 +540,7 @@ swap_pager_cluster(pager, offset, loffset, hoffset)
*hoffset = hoff; *hoffset = hoff;
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FOLLOW|SDB_CLUSTER)) if (swpagerdebug & (SDB_FOLLOW|SDB_CLUSTER))
printf("returns [%lx-%lx]\n", loff, hoff); kprintf("returns [%lx-%lx]\n", loff, hoff);
#endif #endif
} }
@ -571,7 +571,7 @@ swap_pager_io(swp, mlist, npages, flags)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr) if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return (VM_PAGER_FAIL); /* XXX: correct return? */ return (VM_PAGER_FAIL); /* XXX: correct return? */
if (swpagerdebug & (SDB_FOLLOW|SDB_IO)) 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_READ) {
if (flags & B_ASYNC) if (flags & B_ASYNC)
panic("swap_pager_io: cannot do ASYNC reads"); 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) { if (swp->sw_blocks == NULL || ix >= swp->sw_nblocks) {
#ifdef DEBUG #ifdef DEBUG
if ((flags & B_READ) == 0 && (swpagerdebug & SDB_ANOM)) { 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); return(VM_PAGER_BAD);
} }
#endif #endif
@ -632,8 +632,8 @@ swap_pager_io(swp, mlist, npages, flags)
if (swap_pager_free.tqh_first == NULL) { if (swap_pager_free.tqh_first == NULL) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FAIL) if (swpagerdebug & SDB_FAIL)
printf("%s: no available io headers\n", kprintf("%s: no available io headers\n",
"swap_pager_io"); "swap_pager_io");
#endif #endif
return(VM_PAGER_AGAIN); return(VM_PAGER_AGAIN);
} }
@ -647,8 +647,8 @@ swap_pager_io(swp, mlist, npages, flags)
if (swb->swb_block == 0) { if (swb->swb_block == 0) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FAIL) if (swpagerdebug & SDB_FAIL)
printf("swpg_io: rmalloc of %x failed\n", kprintf("swpg_io: rmalloc of %x failed\n",
swp->sw_bsize); swp->sw_bsize);
#endif #endif
/* /*
* XXX this is technically a resource shortage that * XXX this is technically a resource shortage that
@ -661,8 +661,8 @@ swap_pager_io(swp, mlist, npages, flags)
} }
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & (SDB_FULL|SDB_ALLOCBLK)) if (swpagerdebug & (SDB_FULL|SDB_ALLOCBLK))
printf("swpg_io: %p alloc blk %x at ix %x\n", kprintf("swpg_io: %p alloc blk %x at ix %x\n",
swp->sw_blocks, swb->swb_block, ix); swp->sw_blocks, swb->swb_block, ix);
#endif #endif
} }
@ -674,8 +674,8 @@ swap_pager_io(swp, mlist, npages, flags)
if (kva == NULL) { if (kva == NULL) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_FAIL) if (swpagerdebug & SDB_FAIL)
printf("%s: no KVA space to map pages\n", kprintf("%s: no KVA space to map pages\n",
"swap_pager_io"); "swap_pager_io");
#endif #endif
return(VM_PAGER_AGAIN); return(VM_PAGER_AGAIN);
} }
@ -687,8 +687,8 @@ swap_pager_io(swp, mlist, npages, flags)
while (bswlist.b_actf == NULL) { while (bswlist.b_actf == NULL) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_IO) /* XXX what should this be? */ if (swpagerdebug & SDB_IO) /* XXX what should this be? */
printf("swap_pager_io: wait on swbuf for %p (%d)\n", kprintf("swap_pager_io: wait on swbuf for %p (%d)\n",
m, flags); m, flags);
#endif #endif
bswlist.b_flags |= B_WANTED; bswlist.b_flags |= B_WANTED;
tsleep((caddr_t)&bswlist, PSWP+1, "swpgiobuf", 0); tsleep((caddr_t)&bswlist, PSWP+1, "swpgiobuf", 0);
@ -721,16 +721,16 @@ swap_pager_io(swp, mlist, npages, flags)
#ifdef DEBUG #ifdef DEBUG
swap_pager_poip++; swap_pager_poip++;
if (swpagerdebug & SDB_WRITE) if (swpagerdebug & SDB_WRITE)
printf("swpg_io: write: bp=%p swp=%p poip=%d\n", kprintf("swpg_io: write: bp=%p swp=%p poip=%d\n",
bp, swp, swp->sw_poip); bp, swp, swp->sw_poip);
if ((swpagerdebug & SDB_ALLOCBLK) && if ((swpagerdebug & SDB_ALLOCBLK) &&
(swb->swb_mask & mask) != mask) (swb->swb_mask & mask) != mask)
printf("swpg_io: %p write %d pages at %x+%lx\n", kprintf("swpg_io: %p write %d pages at %x+%lx\n",
swp->sw_blocks, npages, swb->swb_block, swp->sw_blocks, npages, swb->swb_block,
atop(off)); atop(off));
if (swpagerdebug & SDB_CLUSTER) if (swpagerdebug & SDB_CLUSTER)
printf("swpg_io: off=%lx, npg=%x, mask=%x, bmask=%x\n", kprintf("swpg_io: off=%lx, npg=%x, mask=%x, bmask=%x\n",
off, npages, mask, swb->swb_mask); off, npages, mask, swb->swb_mask);
#endif #endif
swb->swb_mask |= mask; swb->swb_mask |= mask;
} }
@ -775,14 +775,14 @@ swap_pager_io(swp, mlist, npages, flags)
*/ */
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_IO) if (swpagerdebug & SDB_IO)
printf("swpg_io: IO start: bp %p, db %lx, va %lx, pa %lx\n", 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)); bp, swb->swb_block+btodb(off), kva, VM_PAGE_TO_PHYS(m));
#endif #endif
VOP_STRATEGY(bp); VOP_STRATEGY(bp);
if ((flags & (B_READ|B_ASYNC)) == B_ASYNC) { if ((flags & (B_READ|B_ASYNC)) == B_ASYNC) {
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_IO) if (swpagerdebug & SDB_IO)
printf("swpg_io: IO started: bp %p\n", bp); kprintf("swpg_io: IO started: bp %p\n", bp);
#endif #endif
return(VM_PAGER_PEND); return(VM_PAGER_PEND);
} }
@ -820,9 +820,9 @@ swap_pager_io(swp, mlist, npages, flags)
splx(s); splx(s);
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_IO) 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) if ((swpagerdebug & SDB_FAIL) && rv == VM_PAGER_ERROR)
printf("swpg_io: IO error\n"); kprintf("swpg_io: IO error\n");
#endif #endif
vm_pager_unmap_pages(kva, npages); vm_pager_unmap_pages(kva, npages);
return(rv); return(rv);
@ -842,7 +842,7 @@ swap_pager_clean(rw)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr) if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return; return;
if (swpagerdebug & SDB_FOLLOW) if (swpagerdebug & SDB_FOLLOW)
printf("swpg_clean(%x)\n", rw); kprintf("swpg_clean(%x)\n", rw);
#endif #endif
for (;;) { for (;;) {
@ -900,9 +900,8 @@ swap_pager_clean(rw)
* after awhile. * after awhile.
*/ */
if (spc->spc_flags & SPC_ERROR) { if (spc->spc_flags & SPC_ERROR) {
printf("%s: clean of page %lx failed\n", kprintf("%s: clean of page %lx failed\n",
"swap_pager_clean", "swap_pager_clean", VM_PAGE_TO_PHYS(m));
VM_PAGE_TO_PHYS(m));
m->flags |= PG_LAUNDRY; m->flags |= PG_LAUNDRY;
} else { } else {
m->flags |= PG_CLEAN; m->flags |= PG_CLEAN;
@ -928,7 +927,7 @@ swap_pager_clean(rw)
TAILQ_INSERT_TAIL(&swap_pager_free, spc, spc_list); TAILQ_INSERT_TAIL(&swap_pager_free, spc, spc_list);
#ifdef DEBUG #ifdef DEBUG
if (swpagerdebug & SDB_WRITE) if (swpagerdebug & SDB_WRITE)
printf("swpg_clean: free spc %p\n", spc); kprintf("swpg_clean: free spc %p\n", spc);
#endif #endif
} }
} }
@ -958,7 +957,7 @@ swap_pager_clean_check(mlist, npages, rw)
for (i = 0; i < npages; i++) for (i = 0; i < npages; i++)
if (m == mlist[i]) { if (m == mlist[i]) {
if (swpagerdebug & SDB_ANOM) if (swpagerdebug & SDB_ANOM)
printf( kprintf(
"swpg_clean_check: %s: page %p on list, flags %x\n", "swpg_clean_check: %s: page %p on list, flags %x\n",
rw == B_WRITE ? "write" : "read", mlist[i], spc->spc_flags); rw == B_WRITE ? "write" : "read", mlist[i], spc->spc_flags);
bad = TRUE; bad = TRUE;
@ -984,7 +983,7 @@ swap_pager_iodone(bp)
if ((swpagerdebug & SDB_ANOMPANIC) && panicstr) if ((swpagerdebug & SDB_ANOMPANIC) && panicstr)
return; return;
if (swpagerdebug & SDB_FOLLOW) if (swpagerdebug & SDB_FOLLOW)
printf("swpg_iodone(%p)\n", bp); kprintf("swpg_iodone(%p)\n", bp);
#endif #endif
s = splbio(); s = splbio();
for (spc = swap_pager_inuse.tqh_first; for (spc = swap_pager_inuse.tqh_first;
@ -1007,9 +1006,9 @@ swap_pager_iodone(bp)
#ifdef DEBUG #ifdef DEBUG
--swap_pager_poip; --swap_pager_poip;
if (swpagerdebug & SDB_WRITE) if (swpagerdebug & SDB_WRITE)
printf("swpg_iodone: bp=%p swp=%p flags=%x spc=%p poip=%x\n", kprintf("swpg_iodone: bp=%p swp=%p flags=%x spc=%p poip=%x\n",
bp, spc->spc_swp, spc->spc_swp->sw_flags, bp, spc->spc_swp, spc->spc_swp->sw_flags,
spc, spc->spc_swp->sw_poip); spc, spc->spc_swp->sw_poip);
#endif #endif
spc->spc_swp->sw_poip--; 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 * Copyright (c) 1991, 1993
@ -389,7 +389,7 @@ loop:
} }
#ifdef DEBUG #ifdef DEBUG
if (swapdebug & SDB_FOLLOW) 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 #endif
/* /*
* Nothing to do, back to sleep * Nothing to do, back to sleep
@ -407,9 +407,9 @@ loop:
if (cnt.v_free_count > atop(USPACE)) { if (cnt.v_free_count > atop(USPACE)) {
#ifdef DEBUG #ifdef DEBUG
if (swapdebug & SDB_SWAPIN) if (swapdebug & SDB_SWAPIN)
printf("swapin: pid %d(%s)@%p, pri %d free %d\n", kprintf("swapin: pid %d(%s)@%p, pri %d free %d\n",
p->p_pid, p->p_comm, p->p_addr, p->p_pid, p->p_comm, p->p_addr,
ppri, cnt.v_free_count); ppri, cnt.v_free_count);
#endif #endif
swapin(p); swapin(p);
goto loop; goto loop;
@ -420,15 +420,15 @@ loop:
*/ */
#ifdef DEBUG #ifdef DEBUG
if (swapdebug & SDB_FOLLOW) if (swapdebug & SDB_FOLLOW)
printf("scheduler: no room for pid %d(%s), free %d\n", kprintf("scheduler: no room for pid %d(%s), free %d\n",
p->p_pid, p->p_comm, cnt.v_free_count); p->p_pid, p->p_comm, cnt.v_free_count);
#endif #endif
(void) splhigh(); (void) splhigh();
VM_WAIT; VM_WAIT;
(void) spl0(); (void) spl0();
#ifdef DEBUG #ifdef DEBUG
if (swapdebug & SDB_FOLLOW) 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 #endif
goto loop; goto loop;
} }
@ -495,7 +495,7 @@ swapout_threads()
p = outp2; p = outp2;
#ifdef DEBUG #ifdef DEBUG
if (swapdebug & SDB_SWAPOUT) 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 #endif
if (p) if (p)
swapout(p); swapout(p);
@ -511,9 +511,9 @@ swapout(p)
#ifdef DEBUG #ifdef DEBUG
if (swapdebug & SDB_SWAPOUT) if (swapdebug & SDB_SWAPOUT)
printf("swapout: pid %d(%s)@%p, stat %x pri %d free %d\n", 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_pid, p->p_comm, p->p_addr, p->p_stat,
p->p_slptime, cnt.v_free_count); p->p_slptime, cnt.v_free_count);
#endif #endif
/* /*
@ -607,20 +607,27 @@ void
#if __STDC__ #if __STDC__
iprintf(void (*pr)(const char *, ...), const char *fmt, ...) iprintf(void (*pr)(const char *, ...), const char *fmt, ...)
#else #else
iprintf(pr, fmt /* , va_alist */) iprintf(va_alist)
void (*pr)(); va_dcl
char *fmt;
/* va_dcl */
#endif #endif
{ {
register int i; register int i;
va_list ap; 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) for (i = indent; i >= 8; i -= 8)
(*pr)("\t"); (*pr)("\t");
while (--i >= 0) while (--i >= 0)
(*pr)(" "); (*pr)(" ");
va_start(ap, fmt);
(*pr)("%:", fmt, ap); (*pr)("%:", fmt, ap);
va_end(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 * 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, ret = vm_map_find(parent, NULL, (vm_offset_t) 0,
min, size, TRUE); min, size, TRUE);
if (ret != KERN_SUCCESS) { 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"); panic("kmem_suballoc");
} }
*max = *min + size; *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 * 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 && if (dst_entry->object.vm_object != NULL &&
(dst_entry->object.vm_object->flags & OBJ_INTERNAL) == 0) (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, * If our destination map was wired down,
@ -2237,7 +2237,7 @@ vmspace_fork(vm1)
old_entry->offset, old_entry->offset,
FALSE, FALSE); FALSE, FALSE);
if (check != KERN_SUCCESS) 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 { else {
vm_map_copy_entry(old_map, new_map, old_entry, vm_map_copy_entry(old_map, new_map, old_entry,
@ -2581,7 +2581,7 @@ vm_map_print(map, full)
register vm_map_t map; register vm_map_t map;
boolean_t full; boolean_t full;
{ {
_vm_map_print(map, full, printf); _vm_map_print(map, full, kprintf);
} }
void 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. * Copyright (c) 1988 University of Utah.
@ -149,7 +149,7 @@ sys_mmap(p, v, retval)
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_FOLLOW) 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); p->p_pid, addr, size, prot, flags, fd, pos);
#endif #endif
@ -283,8 +283,8 @@ sys_msync(p, v, retval)
size = (vm_size_t)SCARG(uap, len); size = (vm_size_t)SCARG(uap, len);
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & (MDB_FOLLOW|MDB_SYNC)) if (mmapdebug & (MDB_FOLLOW|MDB_SYNC))
printf("msync(%d): addr %lx len %lx\n", kprintf("msync(%d): addr %lx len %lx\n",
p->p_pid, addr, size); p->p_pid, addr, size);
#endif #endif
/* /*
@ -322,8 +322,8 @@ sys_msync(p, v, retval)
} }
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_SYNC) if (mmapdebug & MDB_SYNC)
printf("msync: cleaning/flushing address range [%lx-%lx)\n", kprintf("msync: cleaning/flushing address range [%lx-%lx)\n",
addr, addr+size); addr, addr+size);
#endif #endif
/* /*
* Could pass this in as a third flag argument to implement * 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); size = (vm_size_t) SCARG(uap, len);
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_FOLLOW) if (mmapdebug & MDB_FOLLOW)
printf("munmap(%d): addr %lx len %lx\n", kprintf("munmap(%d): addr %lx len %lx\n",
p->p_pid, addr, size); p->p_pid, addr, size);
#endif #endif
/* /*
@ -417,7 +417,7 @@ munmapfd(p, fd)
{ {
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_FOLLOW) 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 #endif
/* /*
@ -446,7 +446,7 @@ sys_mprotect(p, v, retval)
prot = SCARG(uap, prot) & VM_PROT_ALL; prot = SCARG(uap, prot) & VM_PROT_ALL;
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_FOLLOW) 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); addr, size, prot);
#endif #endif
/* /*
@ -527,8 +527,8 @@ sys_mlock(p, v, retval)
size = (vm_size_t)SCARG(uap, len); size = (vm_size_t)SCARG(uap, len);
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_FOLLOW) if (mmapdebug & MDB_FOLLOW)
printf("mlock(%d): addr %lx len %lx\n", kprintf("mlock(%d): addr %lx len %lx\n",
p->p_pid, addr, size); p->p_pid, addr, size);
#endif #endif
/* /*
* Align the address to a page boundary, * Align the address to a page boundary,
@ -576,8 +576,8 @@ sys_munlock(p, v, retval)
size = (vm_size_t)SCARG(uap, len); size = (vm_size_t)SCARG(uap, len);
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_FOLLOW) if (mmapdebug & MDB_FOLLOW)
printf("munlock(%d): addr %lx len %lx\n", kprintf("munlock(%d): addr %lx len %lx\n",
p->p_pid, addr, size); p->p_pid, addr, size);
#endif #endif
/* /*
* Align the address to a page boundary, * 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); (void) pager_cache(object, FALSE);
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_MAPIT) if (mmapdebug & MDB_MAPIT)
printf("vm_mmap(%d): ANON *addr %lx size %lx pager %p\n", kprintf("vm_mmap(%d): ANON *addr %lx size %lx pager %p\n",
curproc->p_pid, *addr, size, pager); curproc->p_pid, *addr, size, pager);
#endif #endif
} }
/* /*
@ -725,8 +725,8 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
else { else {
#ifdef DEBUG #ifdef DEBUG
if (object == NULL) if (object == NULL)
printf("vm_mmap: no object: vp %p, pager %p\n", kprintf("vm_mmap: no object: vp %p, pager %p\n",
vp, pager); vp, pager);
#endif #endif
/* /*
* Map it directly. * Map it directly.
@ -807,10 +807,10 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
PMAP_PREFER(foff, &paddr); PMAP_PREFER(foff, &paddr);
#endif #endif
if (paddr != *addr) if (paddr != *addr)
printf( kprintf(
"vm_mmap: pmap botch! " "vm_mmap: pmap botch! "
"[foff %lx, addr %lx, paddr %lx]\n", "[foff %lx, addr %lx, paddr %lx]\n",
foff, *addr, paddr); foff, *addr, paddr);
} }
#endif #endif
} }
@ -880,8 +880,8 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
} }
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_MAPIT) if (mmapdebug & MDB_MAPIT)
printf("vm_mmap(%d): FILE *addr %lx size %lx pager %p\n", kprintf("vm_mmap(%d): FILE *addr %lx size %lx pager %p\n",
curproc->p_pid, *addr, size, pager); curproc->p_pid, *addr, size, pager);
#endif #endif
} }
/* /*
@ -910,7 +910,7 @@ vm_mmap(map, addr, size, prot, maxprot, flags, handle, foff)
out: out:
#ifdef DEBUG #ifdef DEBUG
if (mmapdebug & MDB_MAPIT) if (mmapdebug & MDB_MAPIT)
printf("vm_mmap: rv %d\n", rv); kprintf("vm_mmap: rv %d\n", rv);
#endif #endif
switch (rv) { switch (rv) {
case KERN_SUCCESS: 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 * Copyright (c) 1991, 1993
@ -476,8 +476,8 @@ again:
* Will loose changes to the page. * Will loose changes to the page.
*/ */
if (vm_pager_put(object->pager, p, syncio)) { if (vm_pager_put(object->pager, p, syncio)) {
printf("%s: pager_put error\n", kprintf("%s: pager_put error\n",
"vm_object_page_clean"); "vm_object_page_clean");
p->flags |= PG_CLEAN; p->flags |= PG_CLEAN;
noerror = FALSE; noerror = FALSE;
} }
@ -1410,7 +1410,7 @@ vm_object_print(object, full)
vm_object_t object; vm_object_t object;
boolean_t full; boolean_t full;
{ {
_vm_object_print(object, full, printf); _vm_object_print(object, full, kprintf);
} }
void 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 * Copyright (c) 1991, 1993
@ -340,8 +340,8 @@ vm_pager_unmap_pages(kva, npages)
if (m->flags & PG_PAGEROWNED) if (m->flags & PG_PAGEROWNED)
m->flags &= ~PG_PAGEROWNED; m->flags &= ~PG_PAGEROWNED;
else else
printf("vm_pager_unmap_pages: %p(%lx/%lx) not owned\n", kprintf("vm_pager_unmap_pages: %p(%lx/%lx) not owned\n",
m, va, VM_PAGE_TO_PHYS(m)); m, va, VM_PAGE_TO_PHYS(m));
} }
#endif #endif
pmap_remove(vm_map_pmap(pager_map), kva, kva + size); 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 * Copyright (c) 1982, 1986, 1989, 1993
@ -143,11 +143,11 @@ swapinit()
panic("swapvp"); panic("swapvp");
#endif #endif
if (nswap == 0) if (nswap == 0)
printf("WARNING: no swap space found\n"); kprintf("WARNING: no swap space found\n");
else if ((error = swfree(p, 0)) == ENXIO) 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) { else if (error) {
printf("swfree errno %d\n", error); /* XXX */ kprintf("swfree errno %d\n", error); /* XXX */
panic("swapinit swfree 0"); panic("swapinit swfree 0");
} }
@ -480,8 +480,8 @@ swfree(p, index)
firstblk = rmalloc(swapmap, rootblks - ctod(CLSIZE)); firstblk = rmalloc(swapmap, rootblks - ctod(CLSIZE));
if (firstblk != ctod(CLSIZE)) if (firstblk != ctod(CLSIZE))
panic("swfree miniroot save"); panic("swfree miniroot save");
printf("Preserved %d blocks of miniroot leaving %d pages of swap\n", kprintf("Preserved %d blocks of miniroot leaving %d pages of swap\n",
rootblks, dtoc(nblks - rootblks)); rootblks, dtoc(nblks - rootblks));
} }
return (0); 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. * Copyright (c) 1990 University of Utah.
@ -103,7 +103,7 @@ vnode_pager_init()
{ {
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_init()\n"); kprintf("vnode_pager_init()\n");
#endif #endif
TAILQ_INIT(&vnode_pager_list); TAILQ_INIT(&vnode_pager_list);
} }
@ -128,7 +128,7 @@ vnode_pager_alloc(handle, size, prot, foff)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & (VDB_FOLLOW|VDB_ALLOC)) 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 #endif
/* /*
* Pageout to vnode, no can do yet. * Pageout to vnode, no can do yet.
@ -192,8 +192,8 @@ vnode_pager_alloc(handle, size, prot, foff)
} }
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_ALLOC) if (vpagerdebug & VDB_ALLOC)
printf("vnode_pager_setup: vp %p sz %lx pager %p object %p\n", kprintf("vnode_pager_setup: vp %p sz %lx pager %p object %p\n",
vp, vnp->vnp_size, pager, object); vp, vnp->vnp_size, pager, object);
#endif #endif
return(pager); return(pager);
} }
@ -210,7 +210,7 @@ vnode_pager_dealloc(pager)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_dealloc(%p)\n", pager); kprintf("vnode_pager_dealloc(%p)\n", pager);
#endif #endif
if ((vp = vnp->vnp_vp) != NULL) { if ((vp = vnp->vnp_vp) != NULL) {
vp->v_vmdata = NULL; vp->v_vmdata = NULL;
@ -236,8 +236,8 @@ vnode_pager_getpage(pager, mlist, npages, sync)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_getpage(%p, %p, %x, %x)\n", kprintf("vnode_pager_getpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync); pager, mlist, npages, sync);
#endif #endif
return(vnode_pager_io((vn_pager_t)pager->pg_data, return(vnode_pager_io((vn_pager_t)pager->pg_data,
mlist, npages, sync, UIO_READ)); mlist, npages, sync, UIO_READ));
@ -254,8 +254,8 @@ vnode_pager_putpage(pager, mlist, npages, sync)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_putpage(%p, %p, %x, %x)\n", kprintf("vnode_pager_putpage(%p, %p, %x, %x)\n",
pager, mlist, npages, sync); pager, mlist, npages, sync);
#endif #endif
if (pager == NULL) if (pager == NULL)
return (FALSE); /* ??? */ return (FALSE); /* ??? */
@ -285,7 +285,7 @@ vnode_pager_haspage(pager, offset)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_haspage(%p, %lx)\n", pager, offset); kprintf("vnode_pager_haspage(%p, %lx)\n", pager, offset);
#endif #endif
/* /*
@ -298,7 +298,7 @@ vnode_pager_haspage(pager, offset)
VOP_UNLOCK(vnp->vnp_vp); VOP_UNLOCK(vnp->vnp_vp);
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & (VDB_FAIL|VDB_SIZE)) 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); pager, offset, vnp->vnp_size);
#endif #endif
return(FALSE); return(FALSE);
@ -318,7 +318,7 @@ vnode_pager_haspage(pager, offset)
if (err) { if (err) {
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FAIL) 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); err, pager, offset);
#endif #endif
return(TRUE); return(TRUE);
@ -338,7 +338,7 @@ vnode_pager_cluster(pager, offset, loffset, hoffset)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_cluster(%p, %lx) ", pager, offset); kprintf("vnode_pager_cluster(%p, %lx) ", pager, offset);
#endif #endif
loff = offset; loff = offset;
if (loff >= vnp->vnp_size) if (loff >= vnp->vnp_size)
@ -354,7 +354,7 @@ vnode_pager_cluster(pager, offset, loffset, hoffset)
*hoffset = hoff; *hoffset = hoff;
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("returns [%lx-%lx]\n", loff, hoff); kprintf("returns [%lx-%lx]\n", loff, hoff);
#endif #endif
} }
@ -403,8 +403,8 @@ vnode_pager_setsize(vp, nsize)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & (VDB_FOLLOW|VDB_SIZE)) if (vpagerdebug & (VDB_FOLLOW|VDB_SIZE))
printf("vnode_pager_setsize: vp %p obj %p osz %ld nsz %ld\n", kprintf("vnode_pager_setsize: vp %p obj %p osz %ld nsz %ld\n",
vp, object, vnp->vnp_size, nsize); vp, object, vnp->vnp_size, nsize);
#endif #endif
/* /*
* File has shrunk. * File has shrunk.
@ -522,8 +522,8 @@ vnode_pager_io(vnp, mlist, npages, sync, rw)
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_FOLLOW) if (vpagerdebug & VDB_FOLLOW)
printf("vnode_pager_io(%p, %p, %c): vnode %p\n", kprintf("vnode_pager_io(%p, %p, %c): vnode %p\n",
vnp, m, rw == UIO_READ ? 'R' : 'W', vnp->vnp_vp); vnp, m, rw == UIO_READ ? 'R' : 'W', vnp->vnp_vp);
#endif #endif
foff = m->offset + m->object->paging_offset; 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); vm_pager_unmap_pages(kva, npages);
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_SIZE) if (vpagerdebug & VDB_SIZE)
printf("vnode_pager_io: vp %p, off %ld size %ld\n", kprintf("vnode_pager_io: vp %p, off %ld size %ld\n",
vnp->vnp_vp, foff, vnp->vnp_size); vnp->vnp_vp, foff, vnp->vnp_size);
#endif #endif
return(VM_PAGER_BAD); return(VM_PAGER_BAD);
} }
@ -565,8 +565,8 @@ vnode_pager_io(vnp, mlist, npages, sync, rw)
auio.uio_procp = (struct proc *)0; auio.uio_procp = (struct proc *)0;
#ifdef DEBUG #ifdef DEBUG
if (vpagerdebug & VDB_IO) if (vpagerdebug & VDB_IO)
printf("vnode_pager_io: vp %p kva %lx foff %lx size %x", kprintf("vnode_pager_io: vp %p kva %lx foff %lx size %x",
vnp->vnp_vp, kva, foff, size); vnp->vnp_vp, kva, foff, size);
#endif #endif
if (rw == UIO_READ) if (rw == UIO_READ)
error = VOP_READ(vnp->vnp_vp, &auio, 0, p->p_ucred); 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 #ifdef DEBUG
if (vpagerdebug & VDB_IO) { if (vpagerdebug & VDB_IO) {
if (error || auio.uio_resid) if (error || auio.uio_resid)
printf(" returns error %x, resid %x", kprintf(" returns error %x, resid %x",
error, auio.uio_resid); error, auio.uio_resid);
printf("\n"); kprintf("\n");
} }
#endif #endif
if (!error) { if (!error) {