--- Net2/vm/swap_pager.c 2018/04/24 18:09:23 1.1.1.4 +++ Net2/vm/swap_pager.c 2018/04/24 18:14:58 1.1.1.5 @@ -37,17 +37,9 @@ * * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ * - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00075 - * -------------------- ----- ---------------------- - * - * 22 Jan 1993 Bruce Evans Fixed unmatched spl calls - * - * @(#)swap_pager.c 7.4 (Berkeley) 5/7/91 + * from: @(#)swap_pager.c 7.4 (Berkeley) 5/7/91 + * swap_pager.c,v 1.6.2.1 1993/07/31 12:20:49 cgd Exp */ -static char rcsid[] = "$Header: /var/lib/cvsd/net2/Net2/vm/swap_pager.c,v 1.1.1.4 2018/04/24 18:09:23 root Exp $"; /* * Quick hack to page to dedicated partition(s). @@ -62,12 +54,12 @@ static char rcsid[] = "$Header: /var/lib #include "param.h" #include "proc.h" #include "buf.h" +#include "map.h" #include "systm.h" #include "specdev.h" #include "vnode.h" #include "malloc.h" #include "queue.h" -#include "rlist.h" #include "vm_param.h" #include "queue.h" @@ -362,8 +354,7 @@ swap_pager_dealloc(pager) printf("swpg_dealloc: blk %x\n", bp->swb_block); #endif - rlist_free(&swapmap, (unsigned)bp->swb_block, - (unsigned)bp->swb_block + swp->sw_bsize - 1); + rmfree(swapmap, swp->sw_bsize, bp->swb_block); } splx(s); /* @@ -546,13 +537,8 @@ swap_pager_io(swp, m, flags) return(VM_PAGER_FAIL); } } else if (swb->swb_block == 0) { -#ifdef old swb->swb_block = rmalloc(swapmap, swp->sw_bsize); if (swb->swb_block == 0) { -#else - if (!rlist_alloc(&swapmap, (unsigned)swp->sw_bsize, - (unsigned *)&swb->swb_block)) { -#endif #ifdef DEBUG if (swpagerdebug & SDB_FAIL) printf("swpg_io: rmalloc of %x failed\n", @@ -586,7 +572,7 @@ swap_pager_io(swp, m, flags) m, flags); #endif bswlist.b_flags |= B_WANTED; - sleep((caddr_t)&bswlist, PSWP+1); + tsleep((caddr_t)&bswlist, PSWP+1, "swpgio", 0); } bp = bswlist.av_forw; bswlist.av_forw = bp->av_forw; @@ -594,6 +580,8 @@ swap_pager_io(swp, m, flags) bp->b_flags = B_BUSY | (flags & B_READ); bp->b_proc = &proc0; /* XXX (but without B_PHYS set this is ok) */ bp->b_un.b_addr = (caddr_t)kva; + if (!swb->swb_block) + panic("swap_pager_io: page to first block\n"); bp->b_blkno = swb->swb_block + btodb(off); VHOLD(swapdev_vp); bp->b_vp = swapdev_vp;