summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-03-04 02:04:24 +0000
committerdyson <dyson@FreeBSD.org>1996-03-04 02:04:24 +0000
commit4efa53288e20f5990c002cc7766e3bfc774c2569 (patch)
treefe18461fb3452a82714361a4044f0c074eff3d4f
parent6a695cee3f3965a1b74ad312387b1bec7df29038 (diff)
downloadFreeBSD-src-4efa53288e20f5990c002cc7766e3bfc774c2569.zip
FreeBSD-src-4efa53288e20f5990c002cc7766e3bfc774c2569.tar.gz
Fix a problem that pages in a mapped region were not always
properly invalidated. Now we traverse the object shadow chain properly.
-rw-r--r--sys/vm/vm_map.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 56acb37..8f8c0a3 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.34 1996/03/02 02:54:20 dyson Exp $
+ * $Id: vm_map.c,v 1.35 1996/03/03 18:53:10 peter Exp $
*/
/*
@@ -1532,6 +1532,22 @@ vm_map_clean(map, start, end, syncio, invalidate)
} else {
object = current->object.vm_object;
}
+ /*
+ * Note that there is absolutely no sense in writing out
+ * anonymous objects, so we track down the vnode object
+ * to write out.
+ * We invalidate (remove) all pages from the address space
+ * anyway, for semantic correctness.
+ */
+ while (object->backing_object) {
+ object = object->backing_object;
+ offset += object->backing_object_offset;
+ if (object->size < OFF_TO_IDX( offset + size))
+ size = IDX_TO_OFF(object->size) - offset;
+ }
+ if (invalidate)
+ pmap_remove(vm_map_pmap(map), current->start,
+ current->end);
if (object && (object->type == OBJT_VNODE)) {
/*
* Flush pages if writing is allowed. XXX should we continue
OpenPOWER on IntegriCloud