diff options
author | dillon <dillon@FreeBSD.org> | 2000-04-02 00:55:28 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2000-04-02 00:55:28 +0000 |
commit | 057e33d02ca1d636be1b99e212ebb7911cf4fc62 (patch) | |
tree | c8d43beb4d47e12029b09bb06c919f2a25c818e1 /sys/ufs/ufs | |
parent | 0589fa18882d56c333936da3d552f6f1fb8a3fab (diff) | |
download | FreeBSD-src-057e33d02ca1d636be1b99e212ebb7911cf4fc62.zip FreeBSD-src-057e33d02ca1d636be1b99e212ebb7911cf4fc62.tar.gz |
Change the write-behind code to take more care when starting
async I/O's. The sequential read heuristic has been extended to
cover writes as well. We continue to call cluster_write() normally,
thus blocks in the file will still be reallocated for large (but still
random) I/O's, but I/O will only be initiated for truely sequential
writes.
This solves a number of annoying situations, especially with DBM (hash
method) writes, and also has the side effect of fixing a number of
(stupid) benchmarks.
Reviewed-by: mckusick
Diffstat (limited to 'sys/ufs/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_readwrite.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_readwrite.c b/sys/ufs/ufs/ufs_readwrite.c index 62b0241..48088e9 100644 --- a/sys/ufs/ufs/ufs_readwrite.c +++ b/sys/ufs/ufs/ufs_readwrite.c @@ -379,10 +379,12 @@ WRITE(ap) struct proc *p; ufs_daddr_t lbn; off_t osize; + int seqcount; int blkoffset, error, extended, flags, ioflag, resid, size, xfersize; vm_object_t object; extended = 0; + seqcount = ap->a_ioflag >> 16; ioflag = ap->a_ioflag; uio = ap->a_uio; vp = ap->a_vp; @@ -492,7 +494,7 @@ WRITE(ap) } else if (xfersize + blkoffset == fs->fs_bsize) { if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) { bp->b_flags |= B_CLUSTEROK; - cluster_write(bp, ip->i_size); + cluster_write(bp, ip->i_size, seqcount); } else { bawrite(bp); } |