next up previous contents
Next: 3.7.1 Amd as a Up: 3. Mechanisms for Interposition Previous: 3.6.2 Performance

3.7 User Level Operation

The FiST compiler can easily generate either kernel-resident or user-level code from the same input. Kernel code implements the vnode interface. User level code implements the NFS interface.

The vnode interface was designed to accommodate version 2 of the NFS protocol. Therefore, there is a straightforward mapping of vnode operations to NFS operations, as shown in Table tab-vops-nfs2. Accordingly, the same ``engine'' can easily generate both kernel vnode-layer code and NFS code. See the examples in Appendix sec-appendix-example.

Table: NFS V2 Equivalent Vnode Operations
No. NFS V2 Vnode/VFS No. NFS V2 Vnode/VFS
  Call Name Function   Call Name Function
0 NULL null (trivial) 9 CREATE vn_create
1 GETATTR vn_getattr 10 REMOVE vn_remove
2 SETATTR vn_setattr 11 RENAME vn_rename
3 ROOT vfs_root 12 LINK vn_link
4 LOOKUP vn_lookup 13 SYMLINK vn_symlink
5 READLINK vn_readlink 14 MKDIR vn_mkdir
6 READ vn_read 15 RMDIR vn_rmdir
7 WRITECACHE N/A (rarely used) 16 READDIR vn_readdir
8 WRITE vn_write 17 STATFS vfs_statvfs

Automatically generating code for the latest NFS protocol (version 3) [Pawlowski94] is only marginally more difficult, as can be seen in Table tab-vops-nfs3. There are several new calls that exist only in version 3 of NFS, but they can be safely ignored because there is no direct mapping from a vnode operation to them.

It would be useful to handle NFS V3 as well, and that would mean:

Therefore, I plan support NFS V3.

Table: NFS V3 Equivalent Vnode Operations
No. NFS V3 Call Name Vnode/VFS Function
0 NULL null (trivial)
1 GETATTR vn_getattr
2 SETATTR vn_setattr
3 LOOKUP vn_lookup
4 ACCESS vn_access
5 READLINK vn_readlink
6 READ vn_read
7 WRITE vn_write
8 CREATE vn_create
9 MKDIR vn_mkdir
10 SYMLINK vn_symlink
11 MKNOD a special version of vn_create
12 REMOVE vn_remove
13 RMDIR vn_rmdir
14 RENAME vn_rename
15 LINK vn_link
16 READDIR vn_readdir
17 READDIRPLUS slightly different version of vn_readdir
18 FSSTAT vfs_statvfs
19 FSINFO special version of vfs_statvfs+vn_pathconf
20 PATHCONF vn_pathconf
21 COMMIT must be completely written

next up previous contents
Next: 3.7.1 Amd as a Up: 3. Mechanisms for Interposition Previous: 3.6.2 Performance
Erez Zadok