InterMezzo Kernel API


VFS Interface

Like any file system InterMezzo offers a VFS interface. The VFS interface will have four functions:

validation Before objects are accessed, InterMezzo must ascertain that the current version is available in the cache. Checking versions may be a no-op for synchronized volumes on replicators, or may involve a request to one or more file servers.
cache manipulation InterMezzo uses a standard file system as its primary cache. All read-only and update operations to the file system are done on the cache.
maintain InterMezzo meta data Objects have metadata handled by the FSDB (file system database) - this metadata may change as a result of the operation.
maintain modification journal When updates are made the update operations are logged in the update journal.

A key challenge for a network file system with a persistent cache is to make transactional and ordering guarantees regarding updates to the FSDB, journal and cache.

VFS methods

First we discuss read only calls, then file system updates.

lookup and read_inode Lookup returns a fully initialized inode/dentry to the VFS layer. Almost invariably, it calls iget, which invokes the read_inode method. InterMezzo will cache directories hence requirements for correct operation of lookup are:

Note that the operation could be split across the lookup and read_inode call. If directory data has to be acquired, InterMezzo will need to invoke presto_get_data on the directory. When data or inode has arrived from the server, an atomic update to the cache is made which installs:

The data of the directory is written to the directory inode.
The HAVE_DATA attribute of the directory object is updated

If the attributes of, or the inode itself is not present then presto_getattr needs to be invoked. This will make the following updates atomically (assuming that the inode was not present yet):

Create the inode
Set its attributes as they should be found in the cache
Enter its FID in the FSDB (FID_DB)
Set the HAVE_ATTR flag, volume and version in the FSDB (ATTR_DB).

opendir We will require that when opendir completes, current directory data is present on the system. This involves the steps for filling directory data outlined above in the lookup case.

open


Cache Manager/File Server interface

Users of the file system are not the only processes modifying the cache and databases.