From owner-svn-src-stable-8@FreeBSD.ORG Sun Jul 17 10:13:34 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22605106566B; Sun, 17 Jul 2011 10:13:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1133A8FC19; Sun, 17 Jul 2011 10:13:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HADXrp069600; Sun, 17 Jul 2011 10:13:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HADXaK069597; Sun, 17 Jul 2011 10:13:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201107171013.p6HADXaK069597@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 17 Jul 2011 10:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224127 - stable/8/sys/vm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 10:13:34 -0000 Author: kib Date: Sun Jul 17 10:13:33 2011 New Revision: 224127 URL: http://svn.freebsd.org/changeset/base/224127 Log: MFC r223914: Extract the code to translate VM error into errno, into an exported function vm_mmap_to_errno(). Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/vm/vm_extern.h stable/8/sys/vm/vm_mmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/vm_extern.h ============================================================================== --- stable/8/sys/vm/vm_extern.h Sun Jul 17 08:19:19 2011 (r224126) +++ stable/8/sys/vm/vm_extern.h Sun Jul 17 10:13:33 2011 (r224127) @@ -66,6 +66,7 @@ int vm_fault_wire(vm_map_t, vm_offset_t, int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); void vm_waitproc(struct proc *); int vm_mmap(vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, objtype_t, void *, vm_ooffset_t); +int vm_mmap_to_errno(int rv); void vm_set_page_size(void); void vm_sync_icache(vm_map_t, vm_offset_t, vm_size_t); struct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t); Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Sun Jul 17 08:19:19 2011 (r224126) +++ stable/8/sys/vm/vm_mmap.c Sun Jul 17 10:13:33 2011 (r224127) @@ -1434,6 +1434,13 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_map_wire(map, *addr, *addr + size, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); + return (vm_mmap_to_errno(rv)); +} + +int +vm_mmap_to_errno(int rv) +{ + switch (rv) { case KERN_SUCCESS: return (0);