Make struct buf->b_offset reflect the real byte offset which got
in via the uio struct. This enables device drivers to use != DEV_BSIZE blocking on devices with wierd sector/block sizes (ie CDROM's).
This commit is contained in:
parent
e10741bfea
commit
e620a1cbed
@ -1,4 +1,4 @@
|
||||
/* $Id: ccd.c,v 1.34 1998/07/04 20:45:29 julian Exp $ */
|
||||
/* $Id: ccd.c,v 1.35 1998/07/04 22:30:13 julian Exp $ */
|
||||
|
||||
/* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */
|
||||
|
||||
@ -905,6 +905,7 @@ ccdbuffer(cb, cs, bp, bn, addr, bcount)
|
||||
cbp->cb_buf.b_proc = bp->b_proc;
|
||||
cbp->cb_buf.b_dev = ci->ci_dev; /* XXX */
|
||||
cbp->cb_buf.b_blkno = cbn + cboff + CCD_OFFSET;
|
||||
cbp->cb_buf.b_offset = dbtob(cbn + cboff + CCD_OFFSET);
|
||||
cbp->cb_buf.b_data = addr;
|
||||
cbp->cb_buf.b_vp = ci->ci_vp;
|
||||
LIST_INIT(&cbp->cb_buf.b_dep);
|
||||
|
@ -38,7 +38,7 @@
|
||||
* from: Utah Hdr: vn.c 1.13 94/04/02
|
||||
*
|
||||
* from: @(#)vn.c 8.6 (Berkeley) 4/1/94
|
||||
* $Id: vn.c,v 1.66 1998/07/13 08:22:58 julian Exp $
|
||||
* $Id: vn.c,v 1.67 1998/07/30 15:16:04 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -408,6 +408,7 @@ vnstrategy(struct buf *bp)
|
||||
nbp->b_dev = NODEV;
|
||||
nbp->b_data = addr;
|
||||
nbp->b_blkno = nbn + btodb(off);
|
||||
nbp->b_offset = dbtob(nbn) + off;
|
||||
nbp->b_proc = bp->b_proc;
|
||||
nbp->b_iodone = vniodone;
|
||||
nbp->b_vp = vp;
|
||||
@ -582,6 +583,7 @@ nvsIOreq(void *private ,struct buf *bp)
|
||||
nbp->b_dev = NODEV;
|
||||
nbp->b_data = addr;
|
||||
nbp->b_blkno = nbn + btodb(off);
|
||||
nbp->b_offset = dbtob(nbn) + off;
|
||||
nbp->b_proc = bp->b_proc;
|
||||
nbp->b_iodone = vniodone;
|
||||
nbp->b_vp = vp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: ccd.c,v 1.34 1998/07/04 20:45:29 julian Exp $ */
|
||||
/* $Id: ccd.c,v 1.35 1998/07/04 22:30:13 julian Exp $ */
|
||||
|
||||
/* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */
|
||||
|
||||
@ -905,6 +905,7 @@ ccdbuffer(cb, cs, bp, bn, addr, bcount)
|
||||
cbp->cb_buf.b_proc = bp->b_proc;
|
||||
cbp->cb_buf.b_dev = ci->ci_dev; /* XXX */
|
||||
cbp->cb_buf.b_blkno = cbn + cboff + CCD_OFFSET;
|
||||
cbp->cb_buf.b_offset = dbtob(cbn + cboff + CCD_OFFSET);
|
||||
cbp->cb_buf.b_data = addr;
|
||||
cbp->cb_buf.b_vp = ci->ci_vp;
|
||||
LIST_INIT(&cbp->cb_buf.b_dep);
|
||||
|
@ -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.26 1998/04/04 05:55:05 dyson Exp $
|
||||
* $Id: kern_physio.c,v 1.27 1998/07/04 22:30:21 julian Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -93,7 +93,7 @@ physio(strategy, bp, dev, rw, minp, uio)
|
||||
*/
|
||||
bp->b_saveaddr = sa;
|
||||
bp->b_blkno = btodb(uio->uio_offset);
|
||||
|
||||
bp->b_offset = uio->uio_offset;
|
||||
|
||||
if (uio->uio_segflg == UIO_USERSPACE) {
|
||||
if (rw && !useracc(bp->b_data, bp->b_bufsize, B_WRITE)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user