diff options
author | alc <alc@FreeBSD.org> | 1999-07-11 18:30:32 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-07-11 18:30:32 +0000 |
commit | c7285cff599c1a401d1c26faf50f32b276a23004 (patch) | |
tree | 588552e1e8a49ea53640d89b4e620a04b8e007c5 /sys/vm | |
parent | c3265a3445aac316d7f2e40cc8c45c5b569474b0 (diff) | |
download | FreeBSD-src-c7285cff599c1a401d1c26faf50f32b276a23004.zip FreeBSD-src-c7285cff599c1a401d1c26faf50f32b276a23004.tar.gz |
Cleanup OBJ_ONEMAPPING management.
vm_map.c:
Don't set OBJ_ONEMAPPING on arbitrary vm objects. Only default
and swap type vm objects should have it set. vm_object_deallocate
already handles these cases.
vm_object.c:
If OBJ_ONEMAPPING isn't already clear in vm_object_shadow,
we are in trouble. Instead of clearing it, make it
an assertion that it is already clear.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_map.c | 14 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 6 |
2 files changed, 5 insertions, 15 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index fa4f311..cbe2a2d 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.170 1999/06/17 21:29:38 alc Exp $ + * $Id: vm_map.c,v 1.171 1999/07/01 19:53:41 peter Exp $ */ /* @@ -472,8 +472,6 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, */ if ((object->ref_count > 1) || (object->shadow_count != 0)) { vm_object_clear_flag(object, OBJ_ONEMAPPING); - } else { - vm_object_set_flag(object, OBJ_ONEMAPPING); } } else if ((prev_entry != &map->header) && @@ -739,8 +737,6 @@ vm_map_simplify_entry(map, entry) { \ if (startaddr > entry->start) \ _vm_map_clip_start(map, entry, startaddr); \ - else if (entry->object.vm_object && (entry->object.vm_object->ref_count == 1)) \ - vm_object_set_flag(entry->object.vm_object, OBJ_ONEMAPPING); \ } /* @@ -789,9 +785,6 @@ _vm_map_clip_start(map, entry, start) vm_map_entry_link(map, entry->prev, new_entry); if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - if (new_entry->object.vm_object->ref_count == 1) - vm_object_set_flag(new_entry->object.vm_object, - OBJ_ONEMAPPING); vm_object_reference(new_entry->object.vm_object); } } @@ -808,8 +801,6 @@ _vm_map_clip_start(map, entry, start) { \ if (endaddr < entry->end) \ _vm_map_clip_end(map, entry, endaddr); \ - else if (entry->object.vm_object && (entry->object.vm_object->ref_count == 1)) \ - vm_object_set_flag(entry->object.vm_object, OBJ_ONEMAPPING); \ } /* @@ -853,9 +844,6 @@ _vm_map_clip_end(map, entry, end) vm_map_entry_link(map, entry, new_entry); if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - if (new_entry->object.vm_object->ref_count == 1) - vm_object_set_flag(new_entry->object.vm_object, - OBJ_ONEMAPPING); vm_object_reference(new_entry->object.vm_object); } } diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 9166b06..d29b92b 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.157 1999/06/20 21:47:00 alc Exp $ + * $Id: vm_object.c,v 1.158 1999/07/01 19:53:42 peter Exp $ */ /* @@ -876,6 +876,9 @@ vm_object_shadow(object, offset, length) source->type == OBJT_SWAP)) return; + KASSERT((source->flags & OBJ_ONEMAPPING) == 0, + ("vm_object_shadow: source object has OBJ_ONEMAPPING set.\n")); + /* * Allocate a new object with the given length */ @@ -896,7 +899,6 @@ vm_object_shadow(object, offset, length) result->backing_object = source; if (source) { TAILQ_INSERT_TAIL(&source->shadow_head, result, shadow_list); - vm_object_clear_flag(source, OBJ_ONEMAPPING); source->shadow_count++; source->generation++; result->pg_color = (source->pg_color + OFF_TO_IDX(*offset)) & PQ_L2_MASK; |