Date: Sun, 12 Feb 2017 20:54:31 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313688 - head/sys/kern Message-ID: <201702122054.v1CKsVXK053581@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Feb 12 20:54:31 2017 New Revision: 313688 URL: https://svnweb.freebsd.org/changeset/base/313688 Log: 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 Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Sun Feb 12 19:45:30 2017 (r313687) +++ head/sys/kern/subr_uio.c Sun Feb 12 20:54:31 2017 (r313688) @@ -468,10 +468,11 @@ copyout_map(struct thread *td, vm_offset /* 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702122054.v1CKsVXK053581>