svn commit: r232835 - head/sys/ufs/ffs
Konstantin Belousov
kib at FreeBSD.org
Sun Mar 11 20:23:47 UTC 2012
Author: kib
Date: Sun Mar 11 20:23:46 2012
New Revision: 232835
URL: http://svn.freebsd.org/changeset/base/232835
Log:
Do not fall back to slow synchronous i/o when low on memory or buffers.
The bawrite() schedules the write to happen immediately, and its use
frees the current thread to do more cleanups.
Submitted by: bde
Reviewed by: mckusick
Tested by: pho
MFC after: 2 weeks
Modified:
head/sys/ufs/ffs/ffs_inode.c
Modified: head/sys/ufs/ffs/ffs_inode.c
==============================================================================
--- head/sys/ufs/ffs/ffs_inode.c Sun Mar 11 20:18:14 2012 (r232834)
+++ head/sys/ufs/ffs/ffs_inode.c Sun Mar 11 20:23:46 2012 (r232835)
@@ -133,9 +133,11 @@ ffs_update(vp, waitfor)
else
*((struct ufs2_dinode *)bp->b_data +
ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2;
- if ((waitfor && !DOINGASYNC(vp)) ||
- (vm_page_count_severe() || buf_dirty_count_severe())) {
+ if ((waitfor && !DOINGASYNC(vp)))
error = bwrite(bp);
+ else if (vm_page_count_severe() || buf_dirty_count_severe()) {
+ bawrite(bp);
+ error = 0;
} else {
if (bp->b_bufsize == fs->fs_bsize)
bp->b_flags |= B_CLUSTEROK;
More information about the svn-src-all
mailing list