mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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.
This commit is contained in:
parent
23da239df6
commit
0b64164fca
1 changed files with 17 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
@ -398,6 +398,21 @@ bawrite(struct buf * bp)
|
|||
(void) VOP_BWRITE(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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue