Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jul 2011 10:13:33 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r224127 - stable/8/sys/vm
Message-ID:  <201107171013.p6HADXaK069597@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107171013.p6HADXaK069597>