summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-06-29 05:59:47 +0000
committerpeter <peter@FreeBSD.org>1999-06-29 05:59:47 +0000
commit5f8ebc1b91d5ff4fb0e980bdd2e3d95566052f28 (patch)
tree725ca292cbc72808478d3a19f235c2a854a26054 /sys/kern/vfs_cluster.c
parent0a692c6a0908a65d61a337dc88b2bbe445dd542f (diff)
downloadFreeBSD-src-5f8ebc1b91d5ff4fb0e980bdd2e3d95566052f28.zip
FreeBSD-src-5f8ebc1b91d5ff4fb0e980bdd2e3d95566052f28.tar.gz
Hopefully fix the remaining glitches with the BUF_*() changes. This should
(really this time) fix pageout to swap and a couple of clustering cases. This simplifies BUF_KERNPROC() so that it unconditionally reassigns the lock owner rather than testing B_ASYNC and having the caller decide when to do the reassign. At present this is required because some places use B_CALL/b_iodone to free the buffers without B_ASYNC being set. Also, vfs_cluster.c explicitly calls BUF_KERNPROC() when attaching the buffers rather than the parent walking the cluster_head tailq. Reviewed by: Kirk McKusick <mckusick@mckusick.com>
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index edbe37d..f235e4e 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cluster.c 8.7 (Berkeley) 2/13/94
- * $Id: vfs_cluster.c,v 1.83 1999/06/17 01:25:25 julian Exp $
+ * $Id: vfs_cluster.c,v 1.84 1999/06/26 02:46:08 mckusick Exp $
*/
#include "opt_debug_cluster.h"
@@ -252,7 +252,8 @@ single_block_read:
if ((bp->b_flags & B_CLUSTER) == 0)
vfs_busy_pages(bp, 0);
bp->b_flags &= ~(B_ERROR|B_INVAL);
- BUF_KERNPROC(bp);
+ if (bp->b_flags & (B_ASYNC|B_CALL))
+ BUF_KERNPROC(bp);
error = VOP_STRATEGY(vp, bp);
curproc->p_stats->p_ru.ru_inblock++;
}
@@ -286,7 +287,8 @@ single_block_read:
if ((rbp->b_flags & B_CLUSTER) == 0)
vfs_busy_pages(rbp, 0);
rbp->b_flags &= ~(B_ERROR|B_INVAL);
- BUF_KERNPROC(rbp);
+ if (rbp->b_flags & (B_ASYNC|B_CALL))
+ BUF_KERNPROC(rbp);
(void) VOP_STRATEGY(vp, rbp);
curproc->p_stats->p_ru.ru_inblock++;
}
@@ -414,6 +416,11 @@ cluster_rbuild(vp, filesize, lbn, blkno, size, run, fbp)
break;
}
}
+ /*
+ * XXX fbp from caller may not be B_ASYNC, but we are going
+ * to biodone() it in cluster_callback() anyway
+ */
+ BUF_KERNPROC(tbp);
TAILQ_INSERT_TAIL(&bp->b_cluster.cluster_head,
tbp, b_cluster.cluster_entry);
for (j = 0; j < tbp->b_npages; j += 1) {
@@ -788,6 +795,7 @@ cluster_wbuild(vp, size, start_lbn, len)
reassignbuf(tbp, tbp->b_vp); /* put on clean list */
++tbp->b_vp->v_numoutput;
splx(s);
+ BUF_KERNPROC(tbp);
TAILQ_INSERT_TAIL(&bp->b_cluster.cluster_head,
tbp, b_cluster.cluster_entry);
}
OpenPOWER on IntegriCloud