summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>1999-05-28 03:39:44 +0000
committeralc <alc@FreeBSD.org>1999-05-28 03:39:44 +0000
commit2bb1b6a2aefd1cb787f38007f631497be924d749 (patch)
tree1d6506efd59d763f994a9a7853d7f5a6857d1f21 /sys/vm/vm_map.c
parent86a616fa3ea79a343d3cf7025d8c0337ef459ed4 (diff)
downloadFreeBSD-src-2bb1b6a2aefd1cb787f38007f631497be924d749.zip
FreeBSD-src-2bb1b6a2aefd1cb787f38007f631497be924d749.tar.gz
Avoid the creation of unnecessary shadow objects.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 1fb91f0..39e6444 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.163 1999/05/17 00:53:53 alc Exp $
+ * $Id: vm_map.c,v 1.164 1999/05/18 05:38:48 alc Exp $
*/
/*
@@ -2276,7 +2276,14 @@ vmspace_fork(vm1)
atop(old_entry->end - old_entry->start));
old_entry->object.vm_object = object;
old_entry->offset = (vm_offset_t) 0;
- } else if (old_entry->eflags & MAP_ENTRY_NEEDS_COPY) {
+ }
+
+ /*
+ * Add the reference before calling vm_object_shadow
+ * to insure that a shadow object is created.
+ */
+ vm_object_reference(object);
+ if (old_entry->eflags & MAP_ENTRY_NEEDS_COPY) {
vm_object_shadow(&old_entry->object.vm_object,
&old_entry->offset,
atop(old_entry->end - old_entry->start));
@@ -2291,7 +2298,6 @@ vmspace_fork(vm1)
new_entry = vm_map_entry_create(new_map);
*new_entry = *old_entry;
new_entry->wired_count = 0;
- vm_object_reference(object);
/*
* Insert the entry into the new map -- we know we're
OpenPOWER on IntegriCloud