diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index 43036274ef7d..2e0556fa50ea 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94 - * $Id: nfs_bio.c,v 1.13 1994/06/15 19:59:52 mycroft Exp $ + * $Id: nfs_bio.c,v 1.14 1994/06/22 14:07:37 pk Exp $ */ #include @@ -685,11 +685,30 @@ nfs_doio(bp, cr, p) uiop->uio_procp = p; /* - * Historically, paging was done with physio, but no more. + * Historically, paging was done with physio, but no more... */ - if (bp->b_flags & B_PHYS) - panic("doio phys"); - if (bp->b_flags & B_READ) { + if (bp->b_flags & B_PHYS) { + /* + * ...though reading /dev/drum still gets us here. + */ + io.iov_len = uiop->uio_resid = bp->b_bcount; + /* mapping was done by vmapbuf() */ + io.iov_base = bp->b_data; + uiop->uio_offset = bp->b_blkno * DEV_BSIZE; + if (bp->b_flags & B_READ) { + uiop->uio_rw = UIO_READ; + nfsstats.read_physios++; + error = nfs_readrpc(vp, uiop, cr); + } else { + uiop->uio_rw = UIO_WRITE; + nfsstats.write_physios++; + error = nfs_writerpc(vp, uiop, cr); + } + if (error) { + bp->b_flags |= B_ERROR; + bp->b_error = error; + } + } else if (bp->b_flags & B_READ) { io.iov_len = uiop->uio_resid = bp->b_bcount; io.iov_base = bp->b_data; uiop->uio_rw = UIO_READ; diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index eaf9cb67ea58..4761d0db4ff0 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.23 1994/06/14 03:29:12 gwr Exp $ + * $Id: nfs_vfsops.c,v 1.24 1994/06/22 14:01:45 pk Exp $ */ #include @@ -236,12 +236,10 @@ nfs_mountroot() * On a "dataless" configuration (swap on disk) we will have: * (swdevt[0].sw_dev != NODEV) identifying the swap device. */ - if (swdevt[0].sw_dev != NODEV) { - if (bdevvp(swapdev, &swapdev_vp)) - panic("nfs_mountroot: can't get swap vp for dev %d,%d", - major(swdevt[0].sw_dev), minor(swdevt[0].sw_dev)); + if (bdevvp(swapdev, &swapdev_vp)) + panic("nfs_mountroot: can't setup swap vp"); + if (swdevt[0].sw_dev != NODEV) return (0); - } /* * If swapping to an nfs node: (swdevt[0].sw_dev == NODEV) @@ -256,15 +254,14 @@ nfs_mountroot() */ vp->v_type = VREG; vp->v_flag = 0; - swapdev_vp = vp; - VREF(vp); swdevt[0].sw_vp = vp; /* * Find out how large the swap file is. */ error = VOP_GETATTR(vp, &attr, procp->p_cred->pc_ucred, procp); - if (error) panic("nfs_mountroot: getattr for swap"); + if (error) + panic("nfs_mountroot: getattr for swap"); n = (long) (attr.va_size / DEV_BSIZE); #ifdef DEBUG printf(" swap size: 0x%x (blocks)\n", n); diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 2cd465a981ee..28f54387846e 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94 - * $Id: nfs_vnops.c,v 1.32 1994/06/08 11:37:05 mycroft Exp $ + * $Id: nfs_vnops.c,v 1.33 1994/06/22 14:01:47 pk Exp $ */ /* @@ -2057,8 +2057,8 @@ nfs_strategy(ap) struct proc *p; int error = 0; - if (bp->b_flags & B_PHYS) - panic("nfs physio"); + if ((bp->b_flags & (B_PHYS|B_ASYNC)) == (B_PHYS|B_ASYNC)) + panic("nfs physio/async"); if (bp->b_flags & B_ASYNC) p = (struct proc *)0; else diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index c41794fd5e59..4bb0df1f3198 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 - * $Id: vm_swap.c,v 1.20 1994/06/08 11:45:13 mycroft Exp $ + * $Id: vm_swap.c,v 1.21 1994/06/22 14:02:02 pk Exp $ */ #include @@ -234,14 +234,14 @@ swstrategy(bp) } else index = 0; sp = &swdevt[index]; - if ((bp->b_dev = sp->sw_dev) == NODEV) - panic("swstrategy"); if (sp->sw_vp == NULL) { bp->b_error = ENODEV; bp->b_flags |= B_ERROR; biodone(bp); return; } + if ((bp->b_dev = sp->sw_dev) == NODEV && sp->sw_vp->v_type != VREG) + panic("swstrategy"); VHOLD(sp->sw_vp); if ((bp->b_flags & B_READ) == 0) { if (vp = bp->b_vp) {