Next: Berkeley DB: The Least
Up: Data Operations
Previous: POSIX Data Operations
  Contents
The data operations create and destroy physical copies of virtual files
in a cache in a physical filesystem on the host OS. These operations
are known as `checking out' and `checking in' files, respectively.
When fakefs `checks out' a file, it creates a physical file in
the cache area (see section
) whose contents are
identical to the corresponding virtual file inside fakefs. This is
further subdivided into two modes for read-write and read-only access
to the physical file:
- For read-only access, the physical file may be shared with other
Inodes or even fakefs permanent storage. Modification of the physical
file is prohibited, and may damage the fakefs virtual filesystem if
it occurs.
- For read-write access, exactly one physical file exists for each
distinct open Inode. The normal Unix semantics of a file hard-linked
to multiple different names apply--if the file is opened under two
names, the two file descriptors correspond to the same physical file
as well as the same virtual one. Note that the physical file will have
only one hard link.
When fakefs `checks in' a file, it analyzes a physical file in the
cache and computes an efficient representation of that file (see
chapter 8) to store in the database.
- Fast comparison of files by the Hash of their contents.
- Retrieval of Inodes by Hash (returns list of Inodes that are
identical) or by
pair (returns a Hash).
- Retrieve a file by Inode. In read-write mode, files with distinct
Inode numbers get distinct physical files, while files with identical
Inode numbers get references to a single physical file. Physical files
retrieved from Inodes with non-current Epoch values are always read-only.
- Retrieve a file by Hash. The physical files are read-only.
Only one physical file exists no matter how many times the same Hash
is retrieved by clients. This physical file may be shared with files
accessed read-only by Inode.
- Insert a physical file into fakefs by Inode or by filename
(which creates a new Inode or looks up an existing one). Insert-by-Inode
can only use existing Inodes.
Next: Berkeley DB: The Least
Up: Data Operations
Previous: POSIX Data Operations
  Contents
Zygo Blaxell
2003-03-04