aboutsummaryrefslogtreecommitdiff
path: root/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
diff options
context:
space:
mode:
authorJohn Dyson <dyson@FreeBSD.org>1997-06-15 17:56:53 +0000
committerJohn Dyson <dyson@FreeBSD.org>1997-06-15 17:56:53 +0000
commit6b195d32a1cd26c13df527a3c3d02598119c2f55 (patch)
tree0304209c493d06ccf148bd866e0f1c5261434170 /sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
parentc4bbabfe4f75ae51d86c6eb7098ec17df17ce69b (diff)
downloadsrc-6b195d32a1cd26c13df527a3c3d02598119c2f55.tar.gz
src-6b195d32a1cd26c13df527a3c3d02598119c2f55.zip
Fix a problem with the VN device. Specifically, the VN device can
cause a problem of spiraling death due to buffer resource limitations. The vfs_bio code in general had little ability to handle buffer resource management, and now it does. Also, there are a lot more knobs for tuning the vfs_bio code now. The knobs came free because of the need that there always be some immediately available buffers (non-delayed or locked) for use. Note that the buffer cache code is much less likely to get bogged down with lots of delayed writes, even more so than before.
Notes
Notes: svn path=/head/; revision=26664
Diffstat (limited to 'sys/gnu/fs/ext2fs/ext2_linux_ialloc.c')
-rw-r--r--sys/gnu/fs/ext2fs/ext2_linux_ialloc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
index c20770bc733b..c93c20e6cd98 100644
--- a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
+++ b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
@@ -53,6 +53,7 @@
*/
void mark_buffer_dirty(struct buf *bh)
{
+ numdirtybuffers++;
bh->b_flags |= B_DELWRI;
bh->b_flags &= ~(B_READ | B_ERROR);
}
@@ -62,6 +63,11 @@ void mark_buffer_dirty(struct buf *bh)
*/
int ll_w_block(struct buf * bp, int waitfor)
{
+ if (bp->b_flags & B_DELWRI) {
+ --numdirtybuffers;
+ if (needsbuffer)
+ vfs_bio_need_satisfy();
+ }
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
bp->b_flags |= B_WRITEINPROG;
bp->b_vp->v_numoutput++;