summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cluster.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1998-01-31 11:56:53 +0000
committerdyson <dyson@FreeBSD.org>1998-01-31 11:56:53 +0000
commit2aacd1ab4f077361f06a6cce5d526955a6743e48 (patch)
treeb18bcbfaf5b7cd766657c55c1d3a3785eb442113 /sys/kern/vfs_cluster.c
parent89164485a3d81c25a2b3f202e5dc2ee0aedddd3f (diff)
downloadFreeBSD-src-2aacd1ab4f077361f06a6cce5d526955a6743e48.zip
FreeBSD-src-2aacd1ab4f077361f06a6cce5d526955a6743e48.tar.gz
Change the busy page mgmt, so that when pages are freed, they
MUST be PG_BUSY. It is bogus to free a page that isn't busy, because it is in a state of being "unavailable" when being freed. The additional advantage is that the page_remove code has a better cross-check that the page should be busy and unavailable for other use. There were some minor problems with the collapse code, and this plugs those subtile "holes." Also, the vfs_bio code wasn't checking correctly for PG_BUSY pages. I am going to develop a more consistant scheme for grabbing pages, busy or otherwise. For now, we are stuck with the current morass.
Diffstat (limited to 'sys/kern/vfs_cluster.c')
-rw-r--r--sys/kern/vfs_cluster.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 70f1765..880ca1f 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.51 1998/01/24 02:01:21 dyson Exp $
+ * $Id: vfs_cluster.c,v 1.52 1998/01/31 07:23:11 eivind Exp $
*/
#include "opt_debug_cluster.h"
@@ -720,9 +720,19 @@ cluster_wbuild(vp, size, start_lbn, len)
tbp->b_flags &= ~B_DONE;
splx(s);
}
+
if (tbp->b_flags & B_VMIO) {
+ vm_page_t m;
+
+ if (i != 0) {
+ for (j = 0; j < tbp->b_npages; j += 1) {
+ m = tbp->b_pages[j];
+ if (m->flags & PG_BUSY)
+ goto finishcluster;
+ }
+ }
+
for (j = 0; j < tbp->b_npages; j += 1) {
- vm_page_t m;
m = tbp->b_pages[j];
++m->busy;
++m->object->paging_in_progress;
@@ -746,6 +756,7 @@ cluster_wbuild(vp, size, start_lbn, len)
TAILQ_INSERT_TAIL(&bp->b_cluster.cluster_head,
tbp, b_cluster.cluster_entry);
}
+ finishcluster:
pmap_qenter(trunc_page((vm_offset_t) bp->b_data),
(vm_page_t *) bp->b_pages, bp->b_npages);
if (bp->b_bufsize > bp->b_kvasize)
OpenPOWER on IntegriCloud