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/kern/vfs_cluster.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/kern/vfs_cluster.c')
-rw-r--r-- | sys/kern/vfs_cluster.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index 46fbe3ae206..6f99d0f7077 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cluster.c,v 1.19 2001/02/23 14:42:38 csapuntz Exp $ */ +/* $OpenBSD: vfs_cluster.c,v 1.20 2001/02/23 14:52:50 csapuntz Exp $ */ /* $NetBSD: vfs_cluster.c,v 1.12 1996/04/22 01:39:05 christos Exp $ */ /*- @@ -700,13 +700,6 @@ redo: panic("Clustered write to wrong blocks"); } - /* - * We might as well AGE the buffer here; it's either empty, or - * contains data that we couldn't get rid of (but wanted to). - */ - tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI); - tbp->b_flags |= (B_ASYNC | B_AGE); - if (LIST_FIRST(&tbp->b_dep) != NULL) buf_start(tbp); @@ -717,7 +710,13 @@ redo: tbp->b_bufsize -= size; s = splbio(); - reassignbuf(tbp, tbp->b_vp); /* put on clean list */ + buf_undirty(bp); + /* + * We might as well AGE the buffer here; it's either empty, or + * contains data that we couldn't get rid of (but wanted to). + */ + tbp->b_flags &= ~(B_READ | B_DONE | B_ERROR); + tbp->b_flags |= (B_ASYNC | B_AGE); ++tbp->b_vp->v_numoutput; splx(s); b_save->bs_children[i] = tbp; |