Move primary cache code to libminixfs.
authorBen Gras <ben@minix3.org>
Tue, 16 Oct 2012 15:40:39 +0000 (17:40 +0200)
committerBen Gras <ben@minix3.org>
Tue, 23 Oct 2012 17:48:38 +0000 (19:48 +0200)
commitbd3cde4571379503eea1ffab707a2fdc4d172bb3
tree177c0cbb9e5aa9fcd28505d1fa7eed912f7155fc
parent280d8c668e345d10165c0bc44fab3c7d7657dd05
Move primary cache code to libminixfs.

Add primary cache management feature to libminixfs as mfs and ext2
currently do separately, remove cache code from mfs and ext2, and make
them use the libminixfs interface. This makes all fields of the buf
struct private to libminixfs and FS clients aren't supposed to access
them at all. Only the opaque 'void *data' field (the FS block contents,
used to be called bp) is to be accessed by the FS client.

The main purpose is to implement the interface to the 2ndary vm cache
just once, get rid of some code duplication, and add a little
abstraction to reduce the code inertia of the whole caching business.

Some minor sanity checking and prohibition done by mfs in this code
as removed from the generic primary cache code as a result:
        - checking all inodes are not in use when allocating/resizing
          the cache
        - checking readonly filesystems aren't written to
        - checking the superblock isn't written to on mounted filesystems

The minixfslib code relies on fs_blockstats() in the client filesystem to
return some FS usage information.
53 files changed:
include/minix/libminixfs.h
lib/libminixfs/cache.c
servers/ext2/Makefile
servers/ext2/balloc.c
servers/ext2/buf.h
servers/ext2/cache.c [deleted file]
servers/ext2/const.h
servers/ext2/glo.h
servers/ext2/ialloc.c
servers/ext2/inode.c
servers/ext2/link.c
servers/ext2/main.c
servers/ext2/misc.c
servers/ext2/mount.c
servers/ext2/open.c
servers/ext2/path.c
servers/ext2/protect.c
servers/ext2/proto.h
servers/ext2/read.c
servers/ext2/stadir.c
servers/ext2/super.c
servers/ext2/time.c
servers/ext2/type.h
servers/ext2/utility.c
servers/ext2/write.c
servers/iso9660fs/Makefile
servers/iso9660fs/buf.h
servers/iso9660fs/cache.c [deleted file]
servers/iso9660fs/inode.c
servers/iso9660fs/path.c
servers/iso9660fs/proto.h
servers/iso9660fs/read.c
servers/iso9660fs/stadir.c
servers/mfs/buf.h
servers/mfs/cache.c
servers/mfs/clean.h
servers/mfs/const.h
servers/mfs/glo.h
servers/mfs/inode.c
servers/mfs/link.c
servers/mfs/main.c
servers/mfs/misc.c
servers/mfs/mount.c
servers/mfs/open.c
servers/mfs/path.c
servers/mfs/proto.h
servers/mfs/read.c
servers/mfs/stadir.c
servers/mfs/stats.c
servers/mfs/super.c
servers/mfs/type.h
servers/mfs/utility.c
servers/mfs/write.c