VFS: do not call REQ_FLUSH on the root file system

Change-Id: I15d29a6f3d198e604ea7f7a9db600d6d18b6994b
VFS: provide correct root directory for lookups

This fixes a VFS panic and a chroot(2) security hole.

Change-Id: Ifd1923f886501cf3a73277aab89db974798c47dc
Add libfsdriver: a library to drive file systems

This library provides new abstractions for the upper (VFS) side of
file system services, and should be used for all file system service
implementations from now on.  It provides the following functionality:

  - a function call table abstraction, hiding the details of the
    VFS-FS protocol with simple parameters;
  - a (currently limited) number of per-function steps required for
    all file system implementations, such as copying in and out path
    names and result buffers;
  - a default implementation for multicomponent path lookups, such
    that the file system merely has to implement resolution of single
    components at a time;
  - an abstraction for copying data from and to the file system, which
    allows transparent intraprocess copying as required for the lookup
    implementation;
  - a set of functions to simplify getdents implementations.

The message loop provided by the library is currently for use by
single-threaded file system implementations only.  Multithreaded file
system services may use the more low-level message processing
functionality.

Protocol-level optimizations such as including names in protocol
messages may be hidden entirely in this library.  In addition, in the
future, the lookup implementation may be replaced by a single-
component lookup VFS/FS protocol request as part of a VFS name cache
implementation; this, too, can be hidden entirely in this library.

Change-Id: Ib34f0d0e021dfa3426ce8826efcf3eaa94d3ef3e
test72: fix premature block size update

Updating the current block size before flushing the cache, which still
contained blocks with the old block size, resulted in triggering an
assert on position alignment.

Change-Id: I7a83f3d3bc57bafc08aa6c8df64fbf978273bbfd
test72: fix mock bdev functions

The minixfs library only ever submits vector elements (and reads) of
the system page size. The test implementation was expecting vector
elements (and reads) of the file system block size. The resulting
mismatch caused I/O to fail in various ways, even though this did not
have an effect on the actual test.

Change-Id: I02f4a3efcd4a32916435d82c7d5798e6b78f0a27
libminixfs: do not make fs_sync upcalls

The file system may not be expecting these upcalls at arbitrary
moments, while they serve only as a performance optimization anyway.

Change-Id: I0748fd1f6c2645ddbb64466093ee36025aac45e0
libminixfs: add block I/O routines

The new functionality aims to save each file system server from having
to implement its own block I/O routines just so that it can serve as a
root file system.  The new source file (bio.c) lists the requirements
that file system servers have to fulfill in order to use the routines.

Change-Id: Ia0190fd5c30e8c2097ed8f4b0e3ccde1827e0b92
libsffs: use libfsdriver

Change-Id: Id8377873455771c614371e115643cd906d05f12c
libpuffs: use libfsdriver

Change-Id: I26651578066e1098dc275a9cfbe5710870a13811
libvtreefs: use libfsdriver

Change-Id: I0e6446bd0ccc3b89edc237be441ebfd92585f352
Move clock_time into libsys

Change-Id: Ibc5034617e6f6581de7c4a166ca075b3c357fa82
MFS: use libfsdriver

Change-Id: Ib658c7dea47b81a417755b0554a75288117b431a
ext2: use libfsdriver

- fix panic on truncating files with holes;
- remove block-based readahead, to match MFS.

Change-Id: I385552f8019e9c013a6cb937bcc8e4e7181a4a50
libc: make socketpair(3) use the right device

UDS expects the device number of the actual socket, not the device on
which the socket happens to reside.  The code worked only because PFS
returned the same value in the st_dev stat field, which it will have
to continue doing for a while now.

Change-Id: I426d38a86a96307ff6e6ed8099d37dae02d6bf2b
PFS: use libfsdriver

In order to avoid creating libfsdriver exceptions, two changes to VFS
are necessary:

- the returned position field for reads/writes is no longer abused to
  return the new pipe size; VFS is perfectly capable of updating the
  size itself;
- during system startup, PFS is now sent a mount request, just like all
  other file systems.

In proper "two steps forward, one step back" fashion, the latter point
has the consequence that PFS can no longer drop its privileges at
startup.  This is probably best resolved with a more general solution
for all boot image system services.  The upside is that PFS no longer
needs to be linked with libc.

Change-Id: I92e2410cdb0d93d0e6107bae10bc08efc2dbb8b3
PFS: rewrite, restyle

- remove the buffer pool, inode bitmap, and inode hash table, and
  simplify the code accordingly;
- use theoretically slightly more optimal buffer management;
- put the entire source in one file, instead of having many files
  with one or two functions each;
- convert the code to KNF style.

Change-Id: Ib8f6f0bd99fbc6eb9098fba718e71b8e560783d9
writeisofs: set file struct version field to one

Dictated by the spec and correctly flagged by the new isofs code.

Change-Id: Ie155c30b6a53e40ec42066af0adbcdbf457e5620
Revert "Temporarily disable the is9600 FS server"

This reverts commit ab5c98ee5a2332a1f64b55fa3d056b675b2252ef.
iso9660fs: rewrite ISO 9660 file system server

iso9660fs has been cleaned up and debugged. It now supports:
 * ISO 9660 Level 3,
 * System Use Sharing Protocol (SUSP),
 * Rock Ridge Interchange Protocol (RRIP).

The following Rock Ridge features are supported:
 * POSIX file attributes (PX),
 * POSIX device number (PN),
 * Symbolic links (SL),
 * Alternate file name (NM),
 * Timestamps in 7-byte format (TF).

Change-Id: Ib227411bdda5bc10a957b27ad05fafdc95eca35f
isofs: use libdriver

Change-Id: I5ced800eec92f651f31d9c77c3129fe837ca4614