THE CACHE LAYOUT ================ The local cache will be structured as a set of files: (1) Meta-data file. Contains meta data records (~=inodes) for every "file" in the cache (including itself). Each meta-data record contains a set of direct block pointers, an indirect block pointer and a double indirect block pointer by which the data to which it points can be located on disc. There will always be enough direct pointers to refer to all the blocks in a directory directly. (2) Cell cache catalogue. Any cell for which we have data cached will be recorded in this file. (3) Volume location catalogue. Any volume for which we have data cached will be recorded in this file. Each VL entry points to the cell record to which it belongs. (4) A set of indexes (hash table type thing) with fixed size records as small as I can make them that cross-reference a volume location and a vnode number with an entry in the meta-data file that describes where to find the cached data on disc. Index entries are also time stamped to show the last time they were accessed. (5) The cached vnodes (files/dirs/symlinks) themselves. Note that in the case of a cached file, any hole in the file _actually_ represents a page not yet fetched from the server. There is also a bitmap to indicate which blocks are currently allocated. I wasn't planning on storing user accessiblity data in the cache itself, though I can always change my mind later, because this differs from user to user, and is subject to change without notice from one attempt to read to another due to the lack of notifications from the protection server when ACLs change. This sort of thing will have to be stored in each "struct file".