Official MINIX sources - Automatically replicated from gerrit.minix3.org
Go to file
David van Moolenbroek e321f65582 libfsdriver: support mmap on FSes with no device
This patch adds (very limited) support for memory-mapping pages on
file systems that are mounted on the special "none" device and that
do not implement PEEK support by themselves.  This includes hgfs,
vbfs, and procfs.

The solution is implemented in libvtreefs, and consists of allocating
pages, filling them with content by calling the file system's READ
functionality, passing the pages to VM, and freeing them again.  A new
VM flag is used to indicate that these pages should be mapped in only
once, and thus not cached beyond their single use.  This prevents
stale data from getting mapped in without the involvement of the file
system, which would be problematic on file systems where file contents
may become outdated at any time.  No VM caching means no sharing and
poor performance, but mmap no longer fails on these file systems.

Compared to a libc-based approach, this patch retains the on-demand
nature of mmap.  Especially tail(1) is known to map in a large file
area only to use a small portion of it.

All file systems now need to be given permission for the SETCACHEPAGE
and CLEARCACHE calls to VM.

A very basic regression test is added to test74.

Change-Id: I17afc4cb97315b515cad1542521b98f293b6b559
2014-11-15 11:19:52 +00:00
bin Importing bin/sh 2014-08-29 12:56:04 -04:00
common Fix -DNDEBUG support 2014-08-22 19:12:17 +02:00
distrib Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
docs Clearing history in docs/UPDATING 2014-08-01 14:58:40 +02:00
etc libfsdriver: support mmap on FSes with no device 2014-11-15 11:19:52 +00:00
external Importing external/mit/xorg support rules 2014-11-10 14:43:29 +01:00
games Import NetBSD games/fish command. 2014-09-25 02:03:28 +02:00
gnu Update download urls in fetch.sh 2014-08-07 14:27:32 +02:00
include New sources layout 2014-07-31 16:00:30 +02:00
lib libfsdriver: prefill st_dev for stat requests 2014-11-14 15:54:16 +00:00
libexec LLVM Minix changes 2014-07-28 17:05:59 +02:00
minix libfsdriver: support mmap on FSes with no device 2014-11-15 11:19:52 +00:00
releasetools Fix OS X crossbuilds for arm 2014-10-10 12:56:41 +02:00
sbin INIT died problem / build system robustness 2014-08-28 08:52:50 +02:00
share Importing external/mit/xorg support rules 2014-11-10 14:43:29 +01:00
sys Importing external/mit/xorg support rules 2014-11-10 14:43:29 +01:00
tests LLVM Minix changes 2014-07-28 17:05:59 +02:00
tools buildsystem: fix build errors for x86 on OSX 2014-11-04 11:00:29 +01:00
usr.bin Replace NetBSD grep with OpenBSD grep 2014-09-30 18:09:56 +00:00
usr.sbin Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
.gitignore gitignore: ignore some more generated files 2012-12-06 13:29:20 +00:00
.gitreview build:update 'git review' config to match gerrit.minix3.org 2014-07-28 17:05:15 +02:00
build.sh Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
LICENSE Fix parameter parsing in cut 2010-01-21 10:16:05 +00:00
Makefile INIT died problem / build system robustness 2014-08-28 08:52:50 +02:00
Makefile.inc Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00