From eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8 Mon Sep 17 00:00:00 2001 From: dyson Date: Sun, 15 Jun 1997 17:56:53 +0000 Subject: 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. --- sys/gnu/fs/ext2fs/ext2_linux_ialloc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/gnu/fs/ext2fs/ext2_linux_ialloc.c') diff --git a/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c b/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c index c20770b..c93c20e 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++; -- cgit v1.1