diff options
Diffstat (limited to 'sys/ufs/lfs/lfs_bio.c')
-rw-r--r-- | sys/ufs/lfs/lfs_bio.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c index f95957927cb..6b18e8b1a03 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.6 2001/02/23 14:52:52 csapuntz Exp $ */ +/* $OpenBSD: lfs_bio.c,v 1.7 2001/08/19 15:07:34 miod Exp $ */ /* $NetBSD: lfs_bio.c,v 1.5 1996/02/09 22:28:49 christos Exp $ */ /* @@ -44,6 +44,7 @@ #include <sys/resourcevar.h> #include <sys/mount.h> #include <sys/kernel.h> +#include <sys/timeout.h> #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> @@ -72,6 +73,8 @@ int lfs_writing; /* Set if already kicked off a writer #define WRITE_THRESHHOLD ((nbuf >> 1) - 10) #define LFS_BUFWAIT 2 +struct timeout wakeup_timeout; + int lfs_bwrite(v) void *v; @@ -124,10 +127,11 @@ lfs_bwrite(v) bp->b_synctime = time.tv_sec + 30; s = splbio(); if (bdirties.tqh_first == bp) { - untimeout((void (*)__P((void *)))wakeup, - &bdirties); - timeout((void (*)__P((void *)))wakeup, - &bdirties, 30 * hz); + if (timeout_triggered(&wakeup_timeout)) + timeout_del(&wakeup_timeout); + if (!timeout_intialized(&wakeup_timeout)) + timeout_set(&wakeup_timeout, wakeup, &bdirties); + timeout_add(&wakeup_timeout, 30 * hz); } bp->b_flags &= ~(B_READ | B_ERROR); buf_dirty(bp); |