summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-06-14 04:39:13 +0000
committertholo <tholo@openbsd.org>1996-06-14 04:39:13 +0000
commitfbc02c00a7def18698f87e87ee1b33be9540e55a (patch)
tree90bf8c97b80568ff18577511ce06471006b3cfb3 /sys
parentlong botches (diff)
downloadwireguard-openbsd-fbc02c00a7def18698f87e87ee1b33be9540e55a.tar.xz
wireguard-openbsd-fbc02c00a7def18698f87e87ee1b33be9540e55a.zip
Keep dirty list used by in-kernel update(8) in sync with buffers
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_bio.c16
-rw-r--r--sys/nfs/nfs_syscalls.c4
-rw-r--r--sys/nfs/nfs_vnops.c6
-rw-r--r--sys/ufs/lfs/lfs_bio.c7
-rw-r--r--sys/ufs/lfs/lfs_segment.c6
5 files changed, 34 insertions, 5 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 0b9b597cbdf..c8d3661a2c7 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.7 1996/05/28 13:44:07 deraadt Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.8 1996/06/14 04:41:07 tholo Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.1 1996/05/25 22:40:32 fvdl Exp $ */
/*
@@ -740,6 +740,13 @@ 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)
+ timeout((void (*)__P((void *)))wakeup,
+ &bdirties, 30 * hz);
bp->b_flags |= B_DELWRI;
reassignbuf(bp, bp->b_vp);
biodone(bp);
@@ -900,6 +907,13 @@ 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)
+ timeout((void (*)__P((void *)))wakeup,
+ &bdirties, 30 * hz);
bp->b_flags |= B_DELWRI;
/*
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 3cc0149c2d5..90530d643c4 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.6 1996/04/21 22:30:33 deraadt Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.7 1996/06/14 04:41:08 tholo Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -942,6 +942,8 @@ nfssvc_iod(p)
* up to, but not including nfs_strategy().
*/
if (nbp) {
+ if (nbp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, nbp, b_synclist);
nbp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
reassignbuf(nbp, nbp->b_vp);
nbp->b_vp->v_numoutput++;
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 0786c40fac6..5a6af4a082b 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.8 1996/05/22 11:47:16 deraadt Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.9 1996/06/14 04:41:09 tholo Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62 1996/05/11 18:26:49 mycroft Exp $ */
/*
@@ -2806,6 +2806,8 @@ again:
else {
vp->v_numoutput++;
bp->b_flags |= B_ASYNC;
+ if (bp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, bp, b_synclist);
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
bp->b_dirtyoff = bp->b_dirtyend = 0;
reassignbuf(bp, vp);
@@ -3084,6 +3086,8 @@ nfs_writebp(bp, force)
bp, bp->b_vp, bp->b_validoff, bp->b_validend, bp->b_dirtyoff,
bp->b_dirtyend);
#endif
+ if (bp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, bp, b_synclist);
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
if (oldflags & B_ASYNC) {
diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c
index 48e2e979f9e..436de8780d9 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.2 1996/02/27 07:13:21 niklas Exp $ */
+/* $OpenBSD: lfs_bio.c,v 1.3 1996/06/14 04:39:13 tholo Exp $ */
/* $NetBSD: lfs_bio.c,v 1.5 1996/02/09 22:28:49 christos Exp $ */
/*
@@ -118,6 +118,11 @@ lfs_bwrite(v)
fs->lfs_avail -= fsbtodb(fs, 1);
++locked_queue_count;
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)
+ timeout((void (*)__P((void *)))wakeup,
+ &bdirties, 30 * hz);
bp->b_flags &= ~(B_READ | B_ERROR);
s = splbio();
reassignbuf(bp, bp->b_vp);
diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c
index d14ede9b019..f54a6e8cb01 100644
--- a/sys/ufs/lfs/lfs_segment.c
+++ b/sys/ufs/lfs/lfs_segment.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lfs_segment.c,v 1.2 1996/02/27 07:13:26 niklas Exp $ */
+/* $OpenBSD: lfs_segment.c,v 1.3 1996/06/14 04:39:14 tholo Exp $ */
/* $NetBSD: lfs_segment.c,v 1.4 1996/02/09 22:28:54 christos Exp $ */
/*
@@ -860,6 +860,8 @@ lfs_writeseg(fs, sp)
p += bp->b_bcount;
if (bp->b_flags & B_LOCKED)
--locked_queue_count;
+ if (bp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, bp, b_synclist);
bp->b_flags &= ~(B_ERROR | B_READ | B_DELWRI |
B_LOCKED | B_GATHERED);
if (bp->b_flags & B_CALL) {
@@ -936,6 +938,8 @@ lfs_writesuper(fs)
/* XXX Toggle between first two superblocks; for now just write first */
bp->b_dev = i_dev;
bp->b_flags |= B_BUSY | B_CALL | B_ASYNC;
+ if (bp->b_flags & B_DELWRI)
+ TAILQ_REMOVE(&bdirties, bp, b_synclist);
bp->b_flags &= ~(B_DONE | B_ERROR | B_READ | B_DELWRI);
bp->b_iodone = lfs_supercallback;
vop_strategy_a.a_desc = VDESC(vop_strategy);