-.\" $OpenBSD: buffercache.9,v 1.5 2007/05/31 19:20:00 jmc Exp $
+.\" $OpenBSD: buffercache.9,v 1.6 2008/07/23 16:24:43 beck Exp $
.\" $NetBSD: buffercache.9,v 1.13 2004/06/25 15:31:37 wiz Exp $
.\"
.\" Copyright (c)2003 YAMAMOTO Takashi,
.\"
.\"
.\" ------------------------------------------------------------
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 23 2008 $
.Dt BUFFERCACHE 9
.Os
.Sh NAME
.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.It Fn biowait "bp"
Wait for operations on the buffer to complete.
-When they do, extract and return the I/O's error value.
+When they do, extract and return the I/O's error value.
+If the operation on the buffer is being done via a direct call to a
+.Fn strategy
+type function, then the buffer must be previously initialized with the
+.Dv B_RAW
+flag.
.El
.\" ------------------------------------------------------------
.Sh CODE REFERENCES
-/* $OpenBSD: disksubr.c,v 1.43 2008/06/12 06:58:33 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.44 2008/07/23 16:24:42 beck Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
/* Read it in, slap the new label in, and write it back out */
bp->b_blkno = partoff + LABELSECTOR;
bp->b_bcount = lp->d_secsize;
- bp->b_flags = B_BUSY | B_READ;
+ bp->b_flags = B_BUSY | B_READ | B_RAW;
(*strat)(bp);
if ((error = biowait(bp)) != 0)
goto done;
-/* $OpenBSD: rf_openbsdkintf.c,v 1.49 2008/06/26 05:42:17 ray Exp $ */
+/* $OpenBSD: rf_openbsdkintf.c,v 1.50 2008/07/23 16:24:43 beck Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.109 2001/07/27 03:30:07 oster Exp $ */
/*-
/* Get our ducks in a row for the read. */
bp->b_blkno = RF_COMPONENT_INFO_OFFSET / DEV_BSIZE;
bp->b_bcount = RF_COMPONENT_INFO_SIZE;
- bp->b_flags |= B_READ;
+ bp->b_flags |= (B_READ | B_RAW);
bp->b_resid = RF_COMPONENT_INFO_SIZE / DEV_BSIZE;
(*bdevsw[major(bp->b_dev)].d_strategy)(bp);
/* Get our ducks in a row for the write. */
bp->b_blkno = RF_COMPONENT_INFO_OFFSET / DEV_BSIZE;
bp->b_bcount = RF_COMPONENT_INFO_SIZE;
- bp->b_flags |= B_WRITE;
+ bp->b_flags |= (B_WRITE | B_RAW);
bp->b_resid = RF_COMPONENT_INFO_SIZE / DEV_BSIZE;
memset(bp->b_data, 0, RF_COMPONENT_INFO_SIZE );
-/* $OpenBSD: vnd.c,v 1.87 2008/07/20 01:53:43 krw Exp $ */
+/* $OpenBSD: vnd.c,v 1.88 2008/07/23 16:24:43 beck Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
vbp->vb_buf.b_error);
pbp->b_flags |= B_ERROR;
+ /* XXX does this matter here? */
+ (&vbp->vb_buf)->b_flags |= B_RAW;
pbp->b_error = biowait(&vbp->vb_buf);
}
pbp->b_resid -= vbp->vb_buf.b_bcount;
-/* $OpenBSD: cd9660_vfsops.c,v 1.47 2007/10/03 10:52:11 krw Exp $ */
+/* $OpenBSD: cd9660_vfsops.c,v 1.48 2008/07/23 16:24:43 beck Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */
/*-
for (iso_blknum = 16; iso_blknum < 100; iso_blknum++) {
bp->b_blkno = iso_blknum * btodb(ISO_DEFAULT_BLOCK_SIZE);
bp->b_bcount = ISO_DEFAULT_BLOCK_SIZE;
- bp->b_flags = B_BUSY | B_READ;
+ bp->b_flags = B_BUSY | B_READ | B_RAW;
bp->b_cylinder = bp->b_blkno / lp->d_secpercyl;
/*printf("d_secsize %d iso_blknum %d b_blkno %d bcount %d\n",
-/* $OpenBSD: udf_subr.c,v 1.17 2008/06/12 06:58:39 deraadt Exp $ */
+/* $OpenBSD: udf_subr.c,v 1.18 2008/07/23 16:24:43 beck Exp $ */
/*
* Copyright (c) 2006, Miodrag Vallat
*/
bp->b_blkno = sector * btodb(bsize);
bp->b_bcount = bsize;
- bp->b_flags |= B_READ;
+ bp->b_flags |= (B_READ | B_RAW);
bp->b_resid = bp->b_blkno / lp->d_secpercyl;
(*strat)(bp);
for (sector = mvds_start; sector < mvds_end; sector++) {
bp->b_blkno = sector * btodb(bsize);
bp->b_bcount = bsize;
- bp->b_flags |= B_READ;
+ bp->b_flags |= (B_READ | B_RAW);
bp->b_resid = bp->b_blkno / lp->d_secpercyl;
(*strat)(bp);
-/* $OpenBSD: nfs_bio.c,v 1.51 2008/06/14 19:33:58 beck Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.52 2008/07/23 16:24:43 beck Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
if (bp->b_flags & B_READ) {
uiop->uio_rw = UIO_READ;
nfsstats.read_physios++;
+ bcstats.pendingreads++; /* XXX */
error = nfs_readrpc(vp, uiop);
} else {
iomode = NFSV3WRITE_DATASYNC;
uiop->uio_rw = UIO_WRITE;
nfsstats.write_physios++;
+ bcstats.pendingwrites++; /* XXX */
error = nfs_writerpc(vp, uiop, &iomode, &must_commit);
}
if (error) {
case VREG:
uiop->uio_offset = ((off_t)bp->b_blkno) << DEV_BSHIFT;
nfsstats.read_bios++;
+ bcstats.pendingreads++;
error = nfs_readrpc(vp, uiop);
if (!error) {
bp->b_validoff = 0;
case VLNK:
uiop->uio_offset = (off_t)0;
nfsstats.readlink_bios++;
+ bcstats.pendingreads++; /* XXX */
error = nfs_readlinkrpc(vp, uiop, curproc->p_ucred);
break;
default:
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
uiop->uio_rw = UIO_WRITE;
nfsstats.write_bios++;
+ bcstats.pendingwrites++; /* XXX */
if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE)) == B_ASYNC)
iomode = NFSV3WRITE_UNSTABLE;
else
-/* $OpenBSD: nfs_vnops.c,v 1.95 2008/07/23 11:53:07 art Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.96 2008/07/23 16:24:43 beck Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
}
if( (oldflags & B_ASYNC) == 0) {
+ bp->b_flags |= B_RAW;
int rtval = biowait(bp);
if (!(oldflags & B_DELWRI) && p) {
++p->p_stats->p_ru.ru_oublock;