summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1995-11-05 21:01:15 +0000
committerdyson <dyson@FreeBSD.org>1995-11-05 21:01:15 +0000
commitcfa6fda2522d5851cab5f536a80741f4a5163c2c (patch)
tree8f998729bf9cebad3c2ad5b9da6f7c01a9ca53b4 /sys/ufs
parent1b8e5404ee43d51a47f50d452f1f170f3ca57b22 (diff)
downloadFreeBSD-src-cfa6fda2522d5851cab5f536a80741f4a5163c2c.zip
FreeBSD-src-cfa6fda2522d5851cab5f536a80741f4a5163c2c.tar.gz
Make MNT_ASYNC more effective for UFS. It should not be too much more
dangerous than the original MNT_ASYNC. There might be some minor security considerations due to data writes not being posted as promptly as before. Meta-data operations are still not quite as fast as Linux, but streaming I/O is still higher.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_inode.c6
-rw-r--r--sys/ufs/ufs/ufs_readwrite.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 1b8d25c..3b5f56f 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_inode.c 8.5 (Berkeley) 12/30/93
- * $Id: ffs_inode.c,v 1.14 1995/08/04 05:49:17 davidg Exp $
+ * $Id: ffs_inode.c,v 1.15 1995/08/16 13:16:58 davidg Exp $
*/
#include <sys/param.h>
@@ -222,6 +222,8 @@ ffs_truncate(ap)
oip->i_size = length;
if (aflags & B_SYNC)
bwrite(bp);
+ else if (ovp->v_mount->mnt_flag & MNT_ASYNC)
+ bdwrite(bp);
else
bawrite(bp);
vnode_pager_setsize(ovp, (u_long)length);
@@ -252,6 +254,8 @@ ffs_truncate(ap)
allocbuf(bp, size);
if (aflags & B_SYNC)
bwrite(bp);
+ else if (ovp->v_mount->mnt_flag & MNT_ASYNC)
+ bdwrite(bp);
else
bawrite(bp);
}
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c
index c9b4e82..524a36d 100644
--- a/sys/ufs/ufs/ufs_readwrite.c
+++ b/sys/ufs/ufs/ufs_readwrite.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_readwrite.c 8.7 (Berkeley) 1/21/94
- * $Id: ufs_readwrite.c,v 1.13 1995/09/11 15:56:46 bde Exp $
+ * $Id: ufs_readwrite.c,v 1.14 1995/10/23 02:23:18 dyson Exp $
*/
#ifdef LFS_READWRITE
@@ -280,7 +280,8 @@ WRITE(ap)
if (ioflag & IO_SYNC) {
(void)bwrite(bp);
- } else if (xfersize + blkoffset == fs->fs_bsize) {
+ } else if (xfersize + blkoffset == fs->fs_bsize &&
+ (vp->v_mount->mnt_flag & MNT_ASYNC) == 0) {
if (doclusterwrite) {
bp->b_flags |= B_CLUSTEROK;
cluster_write(bp, ip->i_size);
OpenPOWER on IntegriCloud