diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-14 04:41:10 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-06-14 04:41:10 +0000 |
commit | d21dcfc31ef71322124b54fb4a1e8ea5a0abbc83 (patch) | |
tree | 99549207b0bc40f798c574742bbb356be50ed493 /sys/nfs | |
parent | 642af469b39a29c96cd4063f94e49970db8b4b6a (diff) |
Keep dirty list used by in-kernel update(8) in sync with buffers
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_bio.c | 16 | ||||
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 6 |
3 files changed, 23 insertions, 3 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) { |