Important Data Structures for a File System Implementation

There are two important data structures used to represent information about a virtual file system, the vfs structure and the v-node. Each virtual file system has a vfs structure in memory that describes its type, attributes, and position in the file tree hierarchy. Each file object within that virtual file system can be represented by a v-node.

The vfs structure contains the following fields:

Item Description
vfs_flag Contains the state flags:
VFS_DEVMOUNT
Indicates whether the virtual file system has a physical mount structure underlying it.
VFS_READONLY
Indicates whether the virtual file system is mounted read-only.
vfs_type Identifies the type of file system implementation. Possible values for this field are described in the /usr/include/sys/vmount.h file.
vfs_ops Points to the set of operations for the specified file system type.
vfs_mntdover Points to the mounted-over v-node.
vfs_data Points to the file system implementation data. The interpretation of this field is left to the discretion of the file system implementation. For example, the field could be used to point to data in the kernel extension segment or as an offset to another segment.
vfs_mdata Records the user arguments to the mount call that created this virtual file system. This field has a time stamp. The user arguments are retained to implement the mntctl call, which replaces the /etc/mnttab table.