diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-02-23 14:52:53 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-02-23 14:52:53 +0000 |
commit | eeec1f347171a41707419e89deee7d71381aea55 (patch) | |
tree | 2a1bc87074ca0044ac111b494ffc6eb467896e11 /sys/nfs/nfs_bio.c | |
parent | 96e821437735f981862bb50be47e2c291a615907 (diff) |
Change the B_DELWRI flag using buf_dirty and buf_undirty instead of
manually twiddling it. This allows the buffer cache to more easily
keep track of dirty buffers and decide when it is appropriate to speed
up the syncer.
Insipired by FreeBSD.
Look over by art@
Diffstat (limited to 'sys/nfs/nfs_bio.c')
-rw-r--r-- | sys/nfs/nfs_bio.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index a7c8598f465..950fe138235 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_bio.c,v 1.17 2001/02/23 14:42:38 csapuntz Exp $ */ +/* $OpenBSD: nfs_bio.c,v 1.18 2001/02/23 14:52:50 csapuntz Exp $ */ /* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */ /* @@ -746,10 +746,8 @@ nfs_asyncio(bp, cred) * is currently doing a write for this file and will pick up the * delayed writes before going back to sleep. */ - bp->b_flags |= B_DELWRI; - s = splbio(); - reassignbuf(bp, bp->b_vp); + buf_dirty(bp); splx(s); biodone(bp); return (0); @@ -909,20 +907,12 @@ nfs_doio(bp, cr, p) * B_DELWRI and B_NEEDCOMMIT flags. */ if (error == EINTR || (!error && (bp->b_flags & B_NEEDCOMMIT))) { - bp->b_flags |= B_DELWRI; - - /* - * Since for the B_ASYNC case, nfs_bwrite() has reassigned the - * buffer to the clean list, we have to reassign it back to the - * dirty one. Ugh. - */ - if (bp->b_flags & B_ASYNC) { s = splbio(); - reassignbuf(bp, vp); + buf_dirty(bp); splx(s); - } - else if (error) - bp->b_flags |= B_EINTR; + + if (!(bp->b_flags & B_ASYNC) && error) + bp->b_flags |= B_EINTR; } else { if (error) { bp->b_flags |= B_ERROR; |