1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

Switch copyout_map() to use vm_mmap_object() instead of vm_mmap().

This is both a microoptimization and a move of the consumer to more
commonly used vm function.

Suggested and reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2017-02-12 20:54:31 +00:00
parent 909bacfc59
commit f2277b64ec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=313688

View File

@ -468,10 +468,11 @@ copyout_map(struct thread *td, vm_offset_t *addr, size_t sz)
/* round size up to page boundary */
size = (vm_size_t)round_page(sz);
error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE,
VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0);
if (size == 0)
return (EINVAL);
error = vm_mmap_object(&vms->vm_map, addr, size, VM_PROT_READ |
VM_PROT_WRITE, VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, NULL, 0,
FALSE, td);
return (error);
}