Check out the new USENIX Web site. next up previous
Next: VOP_FCNTL added Up: NetBSD vfs changes Previous: ``layerfs'' library added

File Handles usable in the context of a local filestore

When communicating with the userland daemon dmfsd, DMFS uses file handles to refer to specific files. It does this because on all of the occasions where it needs to communicate with dmfsd (for instance in a VOP_READ() attempting to access non-resident data) none of the potentially multiple paths to this file are available.

To make file handles truly useful in this manner, two changes were made to the kernel. First, three new system calls were added: fhopen(2), fhstat(2), and fhstatfs(2). For security reasons, all three calls are restricted to the superuser. fhopen(2) is similar to open(2) except that the file must already exist, and that it is referenced via a file handle rather than a path. fhstat(2) and fhstatfs(2) are similar to lstat(2) and statfs(2) except that they take file handles rather than paths.

The other change modified the operation of file handle to vnode conversion. In 4.4BSD, the only use of file handles was with network-exported file systems, specifically by the NFS server module. For convenience, the VFS operation which did file handle to vnode conversion also did foreign host export credential verification. Obviously that combination is not appropriate for a tertiary storage system. So I changed the VFS_FHTOVP() operation to just do the file handle to vnode conversion, and added a separate VFS_CHECKEXP() operation to handle the export verification.


next up previous
Next: VOP_FCNTL added Up: NetBSD vfs changes Previous: ``layerfs'' library added
Bill Studenmund
2000-04-24