summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1996-09-06 05:37:53 +0000
committergibbs <gibbs@FreeBSD.org>1996-09-06 05:37:53 +0000
commit458938509f81d8f57dba30656c647d150d1589a5 (patch)
tree47514070393f72b772d83cab152bce8137113337 /sys/kern/vfs_bio.c
parentf5aefd772aee97daf83f3e16bb8949e48289288f (diff)
downloadFreeBSD-src-458938509f81d8f57dba30656c647d150d1589a5.zip
FreeBSD-src-458938509f81d8f57dba30656c647d150d1589a5.tar.gz
Add bowrite.
Bowrite guarantees that buffers queued after a call to bowrite will be written after the specified buffer (on a particular device). Bowrite does this either by taking advantage of hardware ordering support (e.g. tagged queueing on SCSI devices) or resorting to a synchronous write.
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index b278f6c..e9fa85f 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: vfs_bio.c,v 1.95 1996/08/04 20:13:08 phk Exp $
+ * $Id: vfs_bio.c,v 1.96 1996/08/21 21:55:18 dyson Exp $
*/
/*
@@ -313,7 +313,7 @@ bwrite(struct buf * bp)
curproc->p_stats->p_ru.ru_oublock++;
VOP_STRATEGY(bp);
- if ((oldflags & B_ASYNC) == 0) {
+ if ((bp->b_flags & B_ASYNC) == 0) {
int rtval = biowait(bp);
if (oldflags & B_DELWRI) {
@@ -399,6 +399,21 @@ bawrite(struct buf * bp)
}
/*
+ * Ordered write.
+ * Start output on a buffer, but only wait for it to complete if the
+ * output device cannot guarantee ordering in some other way. Devices
+ * that can perform asyncronous ordered writes will set the B_ASYNC
+ * flag in their strategy routine.
+ * The buffer is released when the output completes.
+ */
+int
+bowrite(struct buf * bp)
+{
+ bp->b_flags |= B_ORDERED;
+ return (VOP_BWRITE(bp));
+}
+
+/*
* Release a buffer.
*/
void
OpenPOWER on IntegriCloud