summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1996-06-26 06:12:45 +0000
committerDavid Greenman <dg@FreeBSD.org>1996-06-26 06:12:45 +0000
commitfcb73f99300ab006087d0220abc76d5a7bce1f33 (patch)
tree2382bbcaa9d0484cf9c1d46f6a2df82777aeaa0d /sys/kern
parentd27715b92130b8c6ba8618989572d3c45d7d9947 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_physio.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index a1417acb23b7..5259b67bc4a4 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: kern_physio.c,v 1.12 1995/09/08 11:08:36 bde Exp $
+ * $Id: kern_physio.c,v 1.11.4.1 1995/09/14 07:09:58 davidg Exp $
*/
#include <sys/param.h>
@@ -75,14 +75,14 @@ physio(strategy, bp, dev, rw, minp, uio)
for(i=0;i<uio->uio_iovcnt;i++) {
while( uio->uio_iov[i].iov_len) {
- bp->b_bcount = uio->uio_iov[i].iov_len;
- bp->b_bcount = minp( bp);
- if( minp != minphys)
- bp->b_bcount = minphys( bp);
bp->b_bufsize = bp->b_bcount;
bp->b_flags = B_BUSY | B_PHYS | B_CALL | bufflags;
bp->b_iodone = physwakeup;
bp->b_data = uio->uio_iov[i].iov_base;
+ bp->b_bcount = uio->uio_iov[i].iov_len;
+ bp->b_bcount = minp( bp);
+ if( minp != minphys)
+ bp->b_bcount = minphys( bp);
/*
* pass in the kva from the physical buffer
* for the temporary kernel mapping.
@@ -157,12 +157,16 @@ doerror:
u_int
minphys(struct buf *bp)
{
+ u_int maxphys = MAXPHYS;
- if( bp->b_bcount > MAXPHYS) {
- bp->b_bcount = MAXPHYS;
+ if( ((vm_offset_t) bp->b_data) & PAGE_MASK) {
+ maxphys = MAXPHYS - PAGE_SIZE;
+ }
+
+ if( bp->b_bcount > maxphys) {
+ bp->b_bcount = maxphys;
}
return bp->b_bcount;
-}
int
rawread(dev_t dev, struct uio *uio, int ioflag)