summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1999-03-12 02:24:58 +0000
committerjulian <julian@FreeBSD.org>1999-03-12 02:24:58 +0000
commitf27c95753fda68261265d744a5d8a9e59144d460 (patch)
treea77fd9dc92b2fd307830f703a502e5f52025ed29 /sys/kern/vfs_cluster.c
parent10962136cf7fbc75a1bd22a787b0d92c5b8a655b (diff)
downloadFreeBSD-src-f27c95753fda68261265d744a5d8a9e59144d460.zip
FreeBSD-src-f27c95753fda68261265d744a5d8a9e59144d460.tar.gz
Reviewed by: Many at differnt times in differnt parts,
including alan, john, me, luoqi, and kirk Submitted by: Matt Dillon <dillon@frebsd.org> This change implements a relatively sophisticated fix to getnewbuf(). There were two problems with getnewbuf(). First, the writerecursion can lead to a system stack overflow when you have NFS and/or VN devices in the system. Second, the free/dirty buffer accounting was completely broken. Not only did the nfs routines blow it trying to manually account for the buffer state, but the accounting that was done did not work well with the purpose of their existance: figuring out when getnewbuf() needs to sleep. The meat of the change is to kern/vfs_bio.c. The remaining diffs are all minor except for NFS, which includes both the fixes for bp interaction AND fixes for a 'biodone(): buffer already done' lockup. Sys/buf.h also contains a chaining structure which is not used by this patchset but is used by other patches that are coming soon. This patch deliniated by tags PRE_MAT_GETBUF and POST_MAT_GETBUF. (sorry for the missing T matt)
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 27e9167..f7bd95e 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
- * $Id: vfs_cluster.c,v 1.78 1999/01/21 08:29:05 dillon Exp $
+ * $Id: vfs_cluster.c,v 1.79 1999/01/27 21:49:58 dillon Exp $
*/
#include "opt_debug_cluster.h"
@@ -778,8 +778,8 @@ cluster_wbuild(vp, size, start_lbn, len)
bp->b_bufsize += size;
s = splbio();
- --numdirtybuffers;
- tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI);
+ bundirty(tbp);
+ tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR);
tbp->b_flags |= B_ASYNC;
reassignbuf(tbp, tbp->b_vp); /* put on clean list */
++tbp->b_vp->v_numoutput;
OpenPOWER on IntegriCloud