summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>1999-08-10 04:50:20 +0000
committeralc <alc@FreeBSD.org>1999-08-10 04:50:20 +0000
commit0524a59178a1f58cc25bf44512f12819dc71602a (patch)
treefef67e9b6c5376bcabb522ad9ee48e6613089f51 /sys/vm
parent6118d3300ff2f69a7295ae4b9af52ffaf79b3959 (diff)
downloadFreeBSD-src-0524a59178a1f58cc25bf44512f12819dc71602a.zip
FreeBSD-src-0524a59178a1f58cc25bf44512f12819dc71602a.tar.gz
vm_map_madvise:
Now that behaviors are stored in the vm_map_entry rather than the vm_object, it's no longer necessary to instantiate a vm_object just to hold the behavior. Reviewed by: dillon
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_map.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 9d4aec7..8fd5eb7 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.173 1999/07/21 18:02:27 alc Exp $
+ * $Id: vm_map.c,v 1.174 1999/08/01 06:05:08 alc Exp $
*/
/*
@@ -1028,26 +1028,12 @@ vm_map_madvise(map, start, end, advise)
for(current = entry;
(current != &map->header) && (current->start < end);
current = current->next) {
- vm_size_t size;
if (current->eflags & MAP_ENTRY_IS_SUB_MAP) {
continue;
}
vm_map_clip_end(map, current, end);
- size = current->end - current->start;
-
- /*
- * Create an object if needed
- */
- if (current->object.vm_object == NULL) {
- vm_object_t object;
- if ((advise == MADV_FREE) || (advise == MADV_DONTNEED))
- continue;
- object = vm_object_allocate(OBJT_DEFAULT, OFF_TO_IDX(size));
- current->object.vm_object = object;
- current->offset = 0;
- }
switch (advise) {
case MADV_NORMAL:
@@ -1069,7 +1055,7 @@ vm_map_madvise(map, start, end, advise)
vm_pindex_t pindex;
int count;
pindex = OFF_TO_IDX(current->offset);
- count = OFF_TO_IDX(size);
+ count = OFF_TO_IDX(current->end - current->start);
/*
* MADV_DONTNEED removes the page from all
* pmaps, so pmap_remove is not necessary.
@@ -1084,7 +1070,7 @@ vm_map_madvise(map, start, end, advise)
vm_pindex_t pindex;
int count;
pindex = OFF_TO_IDX(current->offset);
- count = OFF_TO_IDX(size);
+ count = OFF_TO_IDX(current->end - current->start);
vm_object_madvise(current->object.vm_object,
pindex, count, advise);
pmap_object_init_pt(map->pmap, current->start,
OpenPOWER on IntegriCloud