diff options
author | alc <alc@FreeBSD.org> | 1999-06-05 18:21:53 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-06-05 18:21:53 +0000 |
commit | 3d024af49f01fc8f796d7a8ab04aa5d8cde988cc (patch) | |
tree | 23af91064e42f87e0c83a7efde2115ca038b9502 /sys | |
parent | 758e37e0fbe57d3f96b9b525cdbe1968fd10a31f (diff) | |
download | FreeBSD-src-3d024af49f01fc8f796d7a8ab04aa5d8cde988cc.zip FreeBSD-src-3d024af49f01fc8f796d7a8ab04aa5d8cde988cc.tar.gz |
vm_mmap:
Insure that device mappings get MAP_PREFAULT(_PARTIAL) set,
so that 4M page mappings are used when possible.
Reviewed by: Luoqi Chen <luoqi@watermarkgroup.com>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_mmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index b763128..e077a59 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -38,7 +38,7 @@ * from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$ * * @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94 - * $Id: vm_mmap.c,v 1.98 1999/05/16 05:07:33 alc Exp $ + * $Id: vm_mmap.c,v 1.99 1999/05/17 00:53:56 alc Exp $ */ /* @@ -1018,11 +1018,13 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, if (handle == NULL) { object = NULL; + docow = 0; } else { object = vm_pager_allocate(type, handle, objsize, prot, foff); if (object == NULL) return (type == OBJT_DEVICE ? EINVAL : ENOMEM); + docow = MAP_PREFAULT_PARTIAL; } /* @@ -1033,9 +1035,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, flags |= MAP_SHARED; } - docow = 0; if ((flags & (MAP_ANON|MAP_SHARED)) == 0) { - docow = MAP_COPY_ON_WRITE | MAP_PREFAULT_PARTIAL; + docow |= MAP_COPY_ON_WRITE; } #if defined(VM_PROT_READ_IS_EXEC) |