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:
parent
78621becb9
commit
9440653d07
@ -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))
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user