Filesystem/Objects
From WhitixDoc
The virtual filesystem creates and manipulates several types of object.
Files
Files, represented by struct File, are the objects that are read from or written to from userspace. They can also be mapped, polled, and if the file is a directory, a list of file names can be retrieved. File operations in the virtual filesystem are represented by struct FileOps.
VNodes
A vNode (short for virtual filesystem node) is the basic object within the virtual filesystem. It represents a node on the filesystem tree. VNodes are represented by the VNode structure, and operations defined on them are in the VNodeOps structure.
Although files and vNodes seem similar, there are some important differences. Some files may not have vNodes attached to them (such as sockets or pipes), and some vNodes may not be representable by a file (such as symbolic links). Files have state that vNodes do not, such as a position and state.
Superblocks
The virtual filesystem is a collection of filesystems that differ in implementation. Such filesystems are represented by the VfsSuperblock structure, and methods defined for these superblocks are in the SuperBlockOps structure (see include/fs/super.h). Superblocks contain a root vNode, as well as flags that apply to all its children vNodes (such as a read-only flag).
To initialize these superblocks, filesystem modules must register a ReadSuper function with the virtual filesystem. This is by passing a struct Filesystem to the VfsRegisterFileSystem function when the module is first initialised.