diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2015-09-28 18:33:43 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2015-09-28 18:33:43 +0000 |
commit | 7b9fa3b64b54b633f2c56e49ebfd264f0e26c4b1 (patch) | |
tree | 3b05112786a7aa339f5ed124cd1cba0beb1d63d7 /sys/uvm/uvm_mmap.c | |
parent | 581ca1c68542b0da7cc84c10d30e5da60df1a4b2 (diff) |
add a flag to indicate to uvm_map that it should unmap to make space.
this pulls all the relevant operations under the same map locking, and
relieves calling code from responsibility.
ok kettenis matthew
Diffstat (limited to 'sys/uvm/uvm_mmap.c')
-rw-r--r-- | sys/uvm/uvm_mmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index 92498a4e397..61fcf90feb0 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.116 2015/09/26 15:37:28 tedu Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.117 2015/09/28 18:33:42 tedu Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -990,10 +990,8 @@ uvm_mmapanon(vm_map_t map, vaddr_t *addr, vsize_t size, vm_prot_t prot, return(EINVAL); uvmflag |= UVM_FLAG_FIXED; - if ((flags & __MAP_NOREPLACE) == 0) { - /* KERNEL_LOCK held above */ - uvm_unmap(map, *addr, *addr + size); /* zap! */ - } + if ((flags & __MAP_NOREPLACE) == 0) + uvmflag |= UVM_FLAG_UNMAP; } if ((flags & MAP_FIXED) == 0 && size >= __LDPGSZ) @@ -1046,7 +1044,7 @@ uvm_mmapfile(vm_map_t map, vaddr_t *addr, vsize_t size, vm_prot_t prot, uvmflag |= UVM_FLAG_FIXED; if ((flags & __MAP_NOREPLACE) == 0) - uvm_unmap(map, *addr, *addr + size); /* zap! */ + uvmflag |= UVM_FLAG_UNMAP; } /* |