diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 4055b9820045..183b46a499cd 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.16 1995/03/01 23:29:56 davidg Exp $ + * $Id: vm_map.c,v 1.17 1995/03/16 18:17:14 bde Exp $ */ /* @@ -1508,7 +1508,7 @@ vm_map_clean(map, start, end, syncio, invalidate) return (KERN_FAILURE); } if (invalidate) - vm_object_page_remove(object, offset, offset + size); + vm_object_page_remove(object, offset, offset + size, FALSE); vm_object_unlock(object); } start += size; @@ -1634,7 +1634,7 @@ vm_map_delete(map, start, end) if (object == kernel_object || object == kmem_object) vm_object_page_remove(object, entry->offset, - entry->offset + (e - s)); + entry->offset + (e - s), FALSE); else if (!map->is_main_map) vm_object_pmap_remove(object, entry->offset, diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 6ac153817557..b616b6c4ddca 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.c,v 1.33 1995/03/20 02:06:09 davidg Exp $ + * $Id: vm_object.c,v 1.34 1995/03/20 10:20:41 davidg Exp $ */ /* @@ -1390,10 +1390,11 @@ vm_object_collapse(object) * The object must be locked. */ void -vm_object_page_remove(object, start, end) +vm_object_page_remove(object, start, end, clean_only) register vm_object_t object; register vm_offset_t start; register vm_offset_t end; + boolean_t clean_only; { register vm_page_t p, next; vm_offset_t size; @@ -1423,6 +1424,11 @@ again: goto again; } splx(s); + if (clean_only) { + vm_page_test_dirty(p); + if (p->valid & p->dirty) + continue; + } vm_page_protect(p, VM_PROT_NONE); vm_page_lock_queues(); PAGE_WAKEUP(p); @@ -1445,6 +1451,11 @@ again: goto again; } splx(s); + if (clean_only) { + vm_page_test_dirty(p); + if (p->valid & p->dirty) + continue; + } vm_page_protect(p, VM_PROT_NONE); vm_page_lock_queues(); PAGE_WAKEUP(p); @@ -1524,7 +1535,7 @@ vm_object_coalesce(prev_object, next_object, vm_object_page_remove(prev_object, prev_offset + prev_size, - prev_offset + prev_size + next_size); + prev_offset + prev_size + next_size, FALSE); /* * Extend the object if necessary. diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 383a7b8b5d33..84a058c54749 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_object.h,v 1.13 1995/03/16 18:17:24 bde Exp $ + * $Id: vm_object.h,v 1.14 1995/03/20 10:14:55 davidg Exp $ */ /* @@ -175,7 +175,7 @@ void vm_object_enter __P((vm_object_t, vm_pager_t)); void vm_object_init __P((vm_size_t)); vm_object_t vm_object_lookup __P((vm_pager_t)); boolean_t vm_object_page_clean __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t)); -void vm_object_page_remove __P((vm_object_t, vm_offset_t, vm_offset_t)); +void vm_object_page_remove __P((vm_object_t, vm_offset_t, vm_offset_t, boolean_t)); void vm_object_pmap_copy __P((vm_object_t, vm_offset_t, vm_offset_t)); void vm_object_pmap_remove __P((vm_object_t, vm_offset_t, vm_offset_t)); void vm_object_print __P((vm_object_t, boolean_t)); diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 34ccde5fb276..97fd5d68e008 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.32 1995/03/19 23:46:25 davidg Exp $ + * $Id: vnode_pager.c,v 1.33 1995/03/20 10:20:42 davidg Exp $ */ /* @@ -374,7 +374,7 @@ vnode_pager_setsize(vp, nsize) if (round_page((vm_offset_t) nsize) < vnp->vnp_size) { vm_object_lock(object); vm_object_page_remove(object, - round_page((vm_offset_t) nsize), vnp->vnp_size); + round_page((vm_offset_t) nsize), vnp->vnp_size, FALSE); vm_object_unlock(object); } /*