diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2014-04-08 18:48:42 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2014-04-08 18:48:42 +0000 |
commit | 02d836163d83b98646740e86de95f86529a4e3dc (patch) | |
tree | d03eeb9a87e82df4a62b89d50019f8ae504b81e0 /sys/ufs | |
parent | 7ca30df626e08a236325f4c383792994380cb841 (diff) |
add IO_NOCACHE flag to vop_write arguments, which in turn sets B_NOCACHE
on the written buffers. Use the flag for writes from the page daemon to
ensure that we free buffers written out by the page daemon rather than
caching them.
ok kettenis@
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_readwrite.c | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_readwrite.c b/sys/ufs/ext2fs/ext2fs_readwrite.c index 0f9b639c750..152674892e8 100644 --- a/sys/ufs/ext2fs/ext2fs_readwrite.c +++ b/sys/ufs/ext2fs/ext2fs_readwrite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_readwrite.c,v 1.27 2014/01/25 23:31:12 guenther Exp $ */ +/* $OpenBSD: ext2fs_readwrite.c,v 1.28 2014/04/08 18:48:41 beck Exp $ */ /* $NetBSD: ext2fs_readwrite.c,v 1.16 2001/02/27 04:37:47 chs Exp $ */ /*- @@ -245,6 +245,8 @@ ext2fs_write(void *v) error = uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); + if (ioflag & IO_NOCACHE) + bp->b_flags |= B_NOCACHE; if (ioflag & IO_SYNC) (void)bwrite(bp); else if (xfersize + blkoffset == fs->e2fs_bsize) { diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index dbf30681337..e25efadc5c5 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vnops.c,v 1.73 2013/12/12 19:00:10 tedu Exp $ */ +/* $OpenBSD: ffs_vnops.c,v 1.74 2014/04/08 18:48:41 beck Exp $ */ /* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */ /* @@ -378,6 +378,8 @@ ffs_write(void *v) if (error != 0) memset(bp->b_data + blkoffset, 0, xfersize); + if (ioflag & IO_NOCACHE) + bp->b_flags |= B_NOCACHE; if (ioflag & IO_SYNC) (void)bwrite(bp); else if (xfersize + blkoffset == fs->fs_bsize) { |