diff options
author | alc <alc@FreeBSD.org> | 2007-03-25 19:33:40 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2007-03-25 19:33:40 +0000 |
commit | 989c09dfd5111795a3244b9d08b108440cf33169 (patch) | |
tree | 2131c1991db2ce895661c784e9ec2361261718eb /sys | |
parent | f60881085077a74ce84b7e60e85e0a02ffeec38f (diff) | |
download | FreeBSD-src-989c09dfd5111795a3244b9d08b108440cf33169.zip FreeBSD-src-989c09dfd5111795a3244b9d08b108440cf33169.tar.gz |
Two small changes to vm_map_pmap_enter():
1) Eliminate an unnecessary check for fictitious pages. Specifically,
only device-backed objects contain fictitious pages and the object is
not device-backed.
2) Change the types of "psize" and "tmpidx" to vm_pindex_t in order to
prevent possible wrap around with extremely large maps and objects,
respectively. Observed by: tegge (last summer)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_map.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index dc96069..0eae540 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1437,9 +1437,9 @@ void vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_prot_t prot, vm_object_t object, vm_pindex_t pindex, vm_size_t size, int flags) { - vm_offset_t start, tmpidx; - int psize; + vm_offset_t start; vm_page_t p, p_start; + vm_pindex_t psize, tmpidx; boolean_t are_queues_locked; if ((prot & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 || object == NULL) @@ -1493,8 +1493,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_prot_t prot, break; } if ((p->valid & VM_PAGE_BITS_ALL) == VM_PAGE_BITS_ALL && - (p->busy == 0) && - (p->flags & PG_FICTITIOUS) == 0) { + (p->busy == 0)) { if (p_start == NULL) { start = addr + ptoa(tmpidx); p_start = p; |