Add necessary bwillwrite() in writev() entry point.

Deal with excessive dirty buffers when msync() syncs non-contiguous
dirty buffers by checking for the case in UFS *before* checking for
clusterability.
This commit is contained in:
dillon 2000-12-06 20:55:09 +00:00
parent 8580ef5e63
commit 978bf0288d
2 changed files with 4 additions and 3 deletions

View File

@ -496,6 +496,7 @@ writev(p, uap)
}
#endif
cnt = auio.uio_resid;
bwillwrite();
if ((error = fo_write(fp, &auio, fp->f_cred, 0, p))) {
if (auio.uio_resid != cnt && (error == ERESTART ||
error == EINTR || error == EWOULDBLOCK))

View File

@ -495,6 +495,9 @@ WRITE(ap)
if (ioflag & IO_SYNC) {
(void)bwrite(bp);
} else if (vm_page_count_severe() || buf_dirty_count_severe()) {
bp->b_flags |= B_CLUSTEROK;
bawrite(bp);
} else if (xfersize + blkoffset == fs->fs_bsize) {
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) {
bp->b_flags |= B_CLUSTEROK;
@ -502,9 +505,6 @@ WRITE(ap)
} else {
bawrite(bp);
}
} else if (vm_page_count_severe() || buf_dirty_count_severe()) {
bp->b_flags |= B_CLUSTEROK;
bawrite(bp);
} else {
bp->b_flags |= B_CLUSTEROK;
bdwrite(bp);