aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2012-03-11 20:23:46 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2012-03-11 20:23:46 +0000
commit2fd2c0b1e3e21f47e7edfbe398a512bcf875ec3b (patch)
tree1c0af46a7e2a665b32232a999aa1a132227ea553 /sys/ufs/ffs
parent4cd74eecda3f95d986cfd1e61191de359ef119d2 (diff)
downloadsrc-2fd2c0b1e3e21f47e7edfbe398a512bcf875ec3b.tar.gz
src-2fd2c0b1e3e21f47e7edfbe398a512bcf875ec3b.zip
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
Notes
Notes: svn path=/head/; revision=232835
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_inode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 2667e318f1ba..8d6105dac8f8 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -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;