diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-07-21 08:05:40 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-07-21 08:05:40 +0000 |
commit | 2caa172cc05c0bcfc55223ffd67c1621572cc268 (patch) | |
tree | c0aa1bafa09c5f66f17137c69463d61f67cbbf32 | |
parent | d1ca06e9f2af777503835fcef79a3827eef02cd2 (diff) |
Ensure we never use more than one callout table slot
-rw-r--r-- | sys/kern/vfs_bio.c | 12 | ||||
-rw-r--r-- | sys/nfs/nfs_bio.c | 16 | ||||
-rw-r--r-- | sys/ufs/lfs/lfs_bio.c | 7 |
3 files changed, 25 insertions, 10 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 diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index c8d3661a2c7..4e09398ed58 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_bio.c,v 1.8 1996/06/14 04:41:07 tholo Exp $ */ +/* $OpenBSD: nfs_bio.c,v 1.9 1996/07/21 08:05:37 tholo Exp $ */ /* $NetBSD: nfs_bio.c,v 1.25.4.1 1996/05/25 22:40:32 fvdl Exp $ */ /* @@ -744,9 +744,12 @@ nfs_asyncio(bp, cred) TAILQ_REMOVE(&bdirties, bp, b_synclist); TAILQ_INSERT_TAIL(&bdirties, bp, b_synclist); bp->b_synctime = time.tv_sec + 30; - if (bdirties.tqh_first == bp) - timeout((void (*)__P((void *)))wakeup, - &bdirties, 30 * hz); + if (bdirties.tqh_first == bp) { + untimeout((void (*)__P((void *)))wakeup, + &bdirties); + timeout((void (*)__P((void *)))wakeup, + &bdirties, 30 * hz); + } bp->b_flags |= B_DELWRI; reassignbuf(bp, bp->b_vp); biodone(bp); @@ -911,9 +914,12 @@ nfs_doio(bp, cr, p) TAILQ_REMOVE(&bdirties, bp, b_synclist); TAILQ_INSERT_TAIL(&bdirties, bp, b_synclist); bp->b_synctime = time.tv_sec + 30; - if (bdirties.tqh_first == bp) + if (bdirties.tqh_first == bp) { + untimeout((void (*)__P((void *)))wakeup, + &bdirties); timeout((void (*)__P((void *)))wakeup, &bdirties, 30 * hz); + } bp->b_flags |= B_DELWRI; /* diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c index 9d8aec4ae3d..5ce206bec8d 100644 --- a/sys/ufs/lfs/lfs_bio.c +++ b/sys/ufs/lfs/lfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_bio.c,v 1.4 1996/07/01 07:41:49 downsj Exp $ */ +/* $OpenBSD: lfs_bio.c,v 1.5 1996/07/21 08:05:39 tholo Exp $ */ /* $NetBSD: lfs_bio.c,v 1.5 1996/02/09 22:28:49 christos Exp $ */ /* @@ -122,9 +122,12 @@ lfs_bwrite(v) bp->b_flags |= B_DELWRI | B_LOCKED; TAILQ_INSERT_TAIL(&bdirties, bp, b_synclist); bp->b_synctime = time.tv_sec + 30; - if (bdirties.tqh_first == bp) + if (bdirties.tqh_first == bp) { + untimeout((void (*)__P((void *)))wakeup, + &bdirties); timeout((void (*)__P((void *)))wakeup, &bdirties, 30 * hz); + } bp->b_flags &= ~(B_READ | B_ERROR); s = splbio(); reassignbuf(bp, bp->b_vp); |