summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_bio.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-07-21 08:05:40 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-07-21 08:05:40 +0000
commit2caa172cc05c0bcfc55223ffd67c1621572cc268 (patch)
treec0aa1bafa09c5f66f17137c69463d61f67cbbf32 /sys/kern/vfs_bio.c
parentd1ca06e9f2af777503835fcef79a3827eef02cd2 (diff)
Ensure we never use more than one callout table slot
Diffstat (limited to 'sys/kern/vfs_bio.c')
-rw-r--r--sys/kern/vfs_bio.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 9c84cc77e60..3413619f5ac 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.9 1996/07/02 06:52:01 niklas Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.10 1996/07/21 08:05:34 tholo Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*-
@@ -395,9 +395,12 @@ bdwrite(bp)
* a timeout to flush it to disk
*/
TAILQ_INSERT_TAIL(&bdirties, bp, b_synclist);
- if (bdirties.tqh_first == bp)
+ if (bdirties.tqh_first == bp) {
+ untimeout((void (*)__P((void *)))wakeup,
+ &bdirties); /* XXX */
timeout((void (*)__P((void *)))wakeup,
&bdirties, 30 * hz);
+ }
SET(bp->b_flags, B_DELWRI);
curproc->p_stats->p_ru.ru_oublock++; /* XXX */
reassignbuf(bp, bp->b_vp);
@@ -455,9 +458,12 @@ vn_update()
* a wakeup will be scheduled at the time a new
* buffer is enqueued
*/
- if ((bp = bdirties.tqh_first) != NULL)
+ if ((bp = bdirties.tqh_first) != NULL) {
+ untimeout((void (*)__P((void *)))wakeup,
+ &bdirties); /* XXX */
timeout((void (*)__P((void *)))wakeup,
&bdirties, (bp->b_synctime - time.tv_sec) * hz);
+ }
tsleep(&bdirties, PZERO - 1, "dirty", 0);
/*
* Walk the dirty block list, starting an asyncroneous