summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2000-04-02 00:55:28 +0000
committerdillon <dillon@FreeBSD.org>2000-04-02 00:55:28 +0000
commit057e33d02ca1d636be1b99e212ebb7911cf4fc62 (patch)
treec8d43beb4d47e12029b09bb06c919f2a25c818e1 /sys/gnu
parent0589fa18882d56c333936da3d552f6f1fb8a3fab (diff)
downloadFreeBSD-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/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_readwrite.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_readwrite.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c
index d49466d..f054a6e 100644
--- a/sys/gnu/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/ext2fs/ext2_readwrite.c
@@ -175,9 +175,11 @@ WRITE(ap)
struct proc *p;
daddr_t lbn;
off_t osize;
+ int seqcount;
int blkoffset, error, flags, ioflag, resid, size, xfersize;
ioflag = ap->a_ioflag;
+ seqcount = ap->a_ioflag >> 16;
uio = ap->a_uio;
vp = ap->a_vp;
ip = VTOI(vp);
@@ -265,7 +267,7 @@ WRITE(ap)
} else if (xfersize + blkoffset == fs->s_frag_size) {
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);
}
diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c
index d49466d..f054a6e 100644
--- a/sys/gnu/fs/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c
@@ -175,9 +175,11 @@ WRITE(ap)
struct proc *p;
daddr_t lbn;
off_t osize;
+ int seqcount;
int blkoffset, error, flags, ioflag, resid, size, xfersize;
ioflag = ap->a_ioflag;
+ seqcount = ap->a_ioflag >> 16;
uio = ap->a_uio;
vp = ap->a_vp;
ip = VTOI(vp);
@@ -265,7 +267,7 @@ WRITE(ap)
} else if (xfersize + blkoffset == fs->s_frag_size) {
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);
}
OpenPOWER on IntegriCloud