The Venus kernel interface: Initialization and cleanup

Next Previous Contents

## 6. Initialization and cleanup

This section gives brief hints as to desirable features for the Coda FS Driver at startup and upon shutdown or Venus failures. Before entering the discussion it is useful to repeat that the Coda FS Driver maintains the following data:

1. message queues
2. cnodes
3. name cache entries

The name cache entries are entirely private to the driver, so they can easily be manipulated. The message queues will generally have clear points of initialization and destruction. The cnodes are much more delicate. User processes hold reference counts in Coda filesystems and it can be difficult to clean up the cnodes.

It can expect requests through:

1. the message subsystem
2. the VFS layer
3. pioctl interface

Currently the pioctl passes through the VFS for Coda so we can treat these similarly.

## 6.1 Requirements

The following requirements should be accomodated:

1. The message queueus should have `open` and `close` routines. On Unix the opening of the character devices are such routines.
   - Before opening, no messages can be placed.
   - Opening will remove any old messages still pending.
   - Close will notify any sleeping processes that their upcall cannot be completed.
   - Close will free all memory allocated by the message queues.
2. At open the namecache shall be initialized to empty state.
3. Before the message queues are open, all VFS operations will fail. Fortunately this can be achieved by making sure than mounting the Coda filesystem cannot succeed before opening.
4. After closing of the queues, no VFS operations can succeed. Here one needs to be careful, since a few operations (lookup, read/write, readdir) can proceed without upcalls. These must be explicitly blocked.
5. Upon closing the namecache shall be flushed and disabled.
6. All memory held by cnodes can be freed without relying on upcalls.
7. Unmounting the file system can be done without relying on upcalss.
8. Mounting the Coda filesystem should fail gracefully if Venus cannot get the `rootfid` or the attributes of the `rootfid`. The latter is best implemented by Venus fetching these objects before attempting to mount.

NOTE NetBSD in particular but also Linux have not implemented the above requirements fully. For smooth operation this needs to be corrected.

\newpage

Next Previous Contents