summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-06-15 17:56:53 +0000
committerdyson <dyson@FreeBSD.org>1997-06-15 17:56:53 +0000
commiteb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8 (patch)
treeeeee2fc9d75d47696a1cced34c51c39d48b94baa /sys/gnu/fs/ext2fs/ext2_linux_ialloc.c
parentd85a7bf572a5808b870fb2878eb9b8674bb321e2 (diff)
downloadFreeBSD-src-eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8.zip
FreeBSD-src-eb8e1f5e4ef9200ddb9a6b5da00a52e14013f8f8.tar.gz
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.
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 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++;
OpenPOWER on IntegriCloud