From 4efa53288e20f5990c002cc7766e3bfc774c2569 Mon Sep 17 00:00:00 2001 From: dyson Date: Mon, 4 Mar 1996 02:04:24 +0000 Subject: Fix a problem that pages in a mapped region were not always properly invalidated. Now we traverse the object shadow chain properly. --- sys/vm/vm_map.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 -- cgit v1.1