diff options
author | mckusick <mckusick@FreeBSD.org> | 2013-02-16 14:51:30 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2013-02-16 14:51:30 +0000 |
commit | c04f4382b34d7ae4606db6e725d3613fd952a0e4 (patch) | |
tree | 818f7322d46b65c6033f7e8e58cf52d3ebff3771 /sys/geom | |
parent | dcbeb7acb186d90fbec3caed228b522c0b41ad64 (diff) | |
download | FreeBSD-src-c04f4382b34d7ae4606db6e725d3613fd952a0e4.zip FreeBSD-src-c04f4382b34d7ae4606db6e725d3613fd952a0e4.tar.gz |
Add barrier write capability to the VFS buffer interface. A barrier
write is a disk write request that tells the disk that the buffer
being written must be committed to the media along with any writes
that preceeded it before any future blocks may be written to the drive.
Barrier writes are provided by adding the functions bbarrierwrite
(bwrite with barrier) and babarrierwrite (bawrite with barrier).
Following a bbarrierwrite the client knows that the requested buffer
is on the media. It does not ensure that buffers written before that
buffer are on the media. It only ensure that buffers written before
that buffer will get to the media before any buffers written after
that buffer. A flush command must be sent to the disk to ensure that
all earlier written buffers are on the media.
Reviewed by: kib
Tested by: Peter Holm
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_vfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index afc6549..bbed550 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -192,6 +192,10 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp) bip->bio_done = g_vfs_done; bip->bio_caller2 = bp; bip->bio_length = bp->b_bcount; + if (bp->b_flags & B_BARRIER) { + bip->bio_flags |= BIO_ORDERED; + bp->b_flags &= ~B_BARRIER; + } g_io_request(bip, cp); } |