Author: alc
Date: Tue Oct 25 23:19:57 2011
New Revision: 226763
URL: http://svn.freebsd.org/changeset/base/226763

Log:
  MFC r211937
    Add the MAP_PREFAULT_READ option to mmap(2).

Modified:
  stable/8/sys/sys/mman.h
  stable/8/sys/sys/param.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/sys/mman.h
==============================================================================
--- stable/8/sys/sys/mman.h     Tue Oct 25 23:17:53 2011        (r226762)
+++ stable/8/sys/sys/mman.h     Tue Oct 25 23:19:57 2011        (r226763)
@@ -87,6 +87,7 @@
  * Extended flags
  */
 #define        MAP_NOCORE       0x00020000 /* dont include these pages in a 
coredump */
+#define        MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */
 #endif /* __BSD_VISIBLE */
 
 #if __POSIX_VISIBLE >= 199309

Modified: stable/8/sys/sys/param.h
==============================================================================
--- stable/8/sys/sys/param.h    Tue Oct 25 23:17:53 2011        (r226762)
+++ stable/8/sys/sys/param.h    Tue Oct 25 23:19:57 2011        (r226763)
@@ -58,7 +58,7 @@
  *             in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 802512       /* Master, propagated to newvers */
+#define __FreeBSD_version 802513       /* Master, propagated to newvers */
 
 #ifdef _KERNEL
 #define        P_OSREL_SIGWAIT         700000

Modified: stable/8/sys/vm/vm_mmap.c
==============================================================================
--- stable/8/sys/vm/vm_mmap.c   Tue Oct 25 23:17:53 2011        (r226762)
+++ stable/8/sys/vm/vm_mmap.c   Tue Oct 25 23:19:57 2011        (r226763)
@@ -1388,9 +1388,10 @@ vm_mmap(vm_map_t map, vm_offset_t *addr,
                 */
                if (handle == 0)
                        foff = 0;
-       } else {
+       } else if (flags & MAP_PREFAULT_READ)
+               docow = MAP_PREFAULT;
+       else
                docow = MAP_PREFAULT_PARTIAL;
-       }
 
        if ((flags & (MAP_ANON|MAP_SHARED)) == 0)
                docow |= MAP_COPY_ON_WRITE;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to