summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-02-11 22:03:49 +0000
committerdyson <dyson@FreeBSD.org>1996-02-11 22:03:49 +0000
commite46dad739e813e40c45db29ec1899a1cacd02a6c (patch)
treef5eb0869730d65d9bbaa22390b1c14bdd63c698c
parenta4ded7ab0e297e64aca4f98a34d7701bb1f877a1 (diff)
downloadFreeBSD-src-e46dad739e813e40c45db29ec1899a1cacd02a6c.zip
FreeBSD-src-e46dad739e813e40c45db29ec1899a1cacd02a6c.tar.gz
Fixed a really bogus problem with msync ripping pages away from
objects before they were written. Also, don't allow processes without write access to remove pages from vm_objects.
-rw-r--r--sys/vm/vm_map.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index e1d9330..df069cd 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.31 1996/01/04 21:13:17 wollman Exp $
+ * $Id: vm_map.c,v 1.32 1996/01/19 03:59:52 dyson Exp $
*/
/*
@@ -1529,16 +1529,17 @@ vm_map_clean(map, start, end, syncio, invalidate)
* the object before it completes is probably a very bad
* idea.
*/
- if (current->protection & VM_PROT_WRITE)
+ if (current->protection & VM_PROT_WRITE) {
vm_object_page_clean(object,
OFF_TO_IDX(offset),
OFF_TO_IDX(offset + size),
- syncio, TRUE);
- if (invalidate)
- vm_object_page_remove(object,
- OFF_TO_IDX(offset),
- OFF_TO_IDX(offset + size),
- FALSE);
+ (syncio||invalidate)?1:0, TRUE);
+ if (invalidate)
+ vm_object_page_remove(object,
+ OFF_TO_IDX(offset),
+ OFF_TO_IDX(offset + size),
+ FALSE);
+ }
}
start += size;
}
OpenPOWER on IntegriCloud