summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_bio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nfs/nfs_bio.c')
-rw-r--r--sys/nfs/nfs_bio.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 3fc3bf9843f..e0a0c292646 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.11 1997/10/06 15:23:40 csapuntz Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.12 1997/10/06 20:20:44 deraadt Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -740,6 +740,16 @@ nfs_asyncio(bp, cred)
* is currently doing a write for this file and will pick up the
* delayed writes before going back to sleep.
*/
+ if (bp->b_flags & B_DELWRI)
+ 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) {
+ 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);
@@ -900,6 +910,16 @@ nfs_doio(bp, cr, p)
* B_DELWRI and B_NEEDCOMMIT flags.
*/
if (error == EINTR || (!error && (bp->b_flags & B_NEEDCOMMIT))) {
+ if (bp->b_flags & B_DELWRI)
+ 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) {
+ untimeout((void (*)__P((void *)))wakeup,
+ &bdirties);
+ timeout((void (*)__P((void *)))wakeup,
+ &bdirties, 30 * hz);
+ }
bp->b_flags |= B_DELWRI;
/*