SCCS-vsn: sys/vm/vm_swap.c 4.13
SCCS-vsn: sys/kern/kern_physio.c 4.35
-/* kern_physio.c 4.34 82/10/21 */
+/* kern_physio.c 4.35 82/10/31 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
u_int pfcent;
{
register struct buf *bp;
u_int pfcent;
{
register struct buf *bp;
int p2dp;
register struct pte *dpte, *vpte;
int s;
int p2dp;
register struct pte *dpte, *vpte;
int s;
} else
bp->b_un.b_addr = addr;
while (nbytes > 0) {
} else
bp->b_un.b_addr = addr;
while (nbytes > 0) {
- c = imin(ctob(120), nbytes);
- bp->b_bcount = c;
+ bp->b_bcount = nbytes;
+ minphys(bp);
+ c = bp->b_bcount;
bp->b_blkno = dblkno;
bp->b_dev = dev;
if (flag & B_DIRTY) {
bp->b_blkno = dblkno;
bp->b_dev = dev;
if (flag & B_DIRTY) {
#ifdef TRACE
trace(TR_SWAPIO, dev, bp->b_blkno);
#endif
#ifdef TRACE
trace(TR_SWAPIO, dev, bp->b_blkno);
#endif
- (*bdevsw[major(dev)].d_strategy)(bp);
+ physstrat(bp, bdevsw[major(dev).d_strategy, PSWP);
if (flag & B_DIRTY) {
if (c < nbytes)
panic("big push");
return;
}
if (flag & B_DIRTY) {
if (c < nbytes)
panic("big push");
return;
}
- s = spl6();
- while((bp->b_flags&B_DONE)==0)
- sleep((caddr_t)bp, PSWP);
- splx(s);
bp->b_un.b_addr += c;
bp->b_flags &= ~B_DONE;
if (bp->b_flags & B_ERROR) {
bp->b_un.b_addr += c;
bp->b_flags &= ~B_DONE;
if (bp->b_flags & B_ERROR) {
swkill(p, (char *)0);
}
nbytes -= c;
swkill(p, (char *)0);
}
nbytes -= c;
+ dblkno += c / DEV_BSIZE;
}
s = spl6();
bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS|B_PAGET|B_UAREA|B_DIRTY);
}
s = spl6();
bp->b_flags &= ~(B_BUSY|B_WANTED|B_PHYS|B_PAGET|B_UAREA|B_DIRTY);
while (iov->iov_len > 0) {
bp->b_flags = B_BUSY | B_PHYS | rw;
bp->b_dev = dev;
while (iov->iov_len > 0) {
bp->b_flags = B_BUSY | B_PHYS | rw;
bp->b_dev = dev;
- bp->b_blkno = uio->uio_offset >> PGSHIFT;
+ bp->b_blkno = uio->uio_offset / DEV_BSIZE;
bp->b_bcount = iov->iov_len;
(*mincnt)(bp);
c = bp->b_bcount;
u.u_procp->p_flag |= SPHYSIO;
vslock(a = bp->b_un.b_addr, c);
bp->b_bcount = iov->iov_len;
(*mincnt)(bp);
c = bp->b_bcount;
u.u_procp->p_flag |= SPHYSIO;
vslock(a = bp->b_un.b_addr, c);
+ physstrat(bp, strat, PRIBIO);
- while ((bp->b_flags&B_DONE) == 0)
- sleep((caddr_t)bp, PRIBIO);
vsunlock(a, c, rw);
u.u_procp->p_flag &= ~SPHYSIO;
if (bp->b_flags&B_WANTED)
vsunlock(a, c, rw);
u.u_procp->p_flag &= ~SPHYSIO;
if (bp->b_flags&B_WANTED)
unsigned
minphys(bp)
struct buf *bp;
unsigned
minphys(bp)
struct buf *bp;
-/* vm_swap.c 4.12 82/10/22 */
+/* vm_swap.c 4.13 82/10/31 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
if (rootdev == dumpdev)
bp->b_blkno += MINIROOTSIZE;
#endif
if (rootdev == dumpdev)
bp->b_blkno += MINIROOTSIZE;
#endif
- sz = (bp->b_bcount+511)/512;
+ sz = howmany(bp->b_bocunt, DEV_BSIZE);
off = bp->b_blkno % DMMAX;
if (bp->b_blkno+sz > nswap || off+sz > DMMAX) {
bp->b_flags |= B_ERROR;
off = bp->b_blkno % DMMAX;
if (bp->b_blkno+sz > nswap || off+sz > DMMAX) {
bp->b_flags |= B_ERROR;
{
register swblk_t vsbase;
register long blk;
{
register swblk_t vsbase;
register long blk;
+ dev = swdevt[index].sw_dev;
+ (*bdevsw[major(dev)].d_open)(dev, FREAD|FWRITE);
swdevt[index].sw_freed = 1;
for (vsbase = index*DMMAX; vsbase < nswap; vsbase += nswdev*DMMAX) {
blk = nswap - vsbase;
swdevt[index].sw_freed = 1;
for (vsbase = index*DMMAX; vsbase < nswap; vsbase += nswdev*DMMAX) {
blk = nswap - vsbase;
* hunk which needs special treatment anyways.
*/
argdev = swdevt[0].sw_dev;
* hunk which needs special treatment anyways.
*/
argdev = swdevt[0].sw_dev;
- rminit(argmap, (long)(blk/2-CLSIZE), (long)CLSIZE,
- "argmap", ARGMAPSIZE);
+ rminit(argmap, (long)(blk/2-ctod(CLSIZE)),
+ (long)ctod(CLSIZE), "argmap", ARGMAPSIZE);
/*
* First of all chunks... initialize the swapmap
* the second half of the hunk.
/*
* First of all chunks... initialize the swapmap
* the second half of the hunk.