Virtual File System.
More...
Virtual Filesystem
The virtual is an abstraction over filesystems used to separate the high level interface from the low level fs-dependent implementation. It also allows for computing a path which spans over multiple different imbricked filesystems, effectively viewing it as a single big filesystem from the user's POV.
Design
The VFS splits each mounted filesystem into 2 parts:
- The virtual filesystem: The filesystem as a whole
- Virtual nodes: The individual components (files, dirs, ...) that make up this filesystem
The VFS driver keeps track of all the present virtual filesystem, and addresses them in order to find a requested path. When "opening" a file, we instead ask the corresponding VFS to create the VNODE which corresponds to this file, and interact with it instead. All the filesystem dependant logic is hidden from the VFS driver.
- See also
- http://www.cs.fsu.edu/~awang/courses/cop5611_s2024/vnode.pdf
◆ DECLARE_FILESYSTEM
| #define DECLARE_FILESYSTEM |
( |
|
fs_name, |
|
|
|
fs_new |
|
) |
| |
Value: SECTION(".data.vfs.filesystems") \
MAYBE_UNUSED \
static
vfs_fs_t fs_name##_fs_declaration = { \
.new = fs_new, \
}
#define stringify(_x)
Preprocess an expression into a raw string.
Definition: stringify.h:8
Represents a file system format.
Definition: vfs.h:253
const char *const name
Name of the filesystem.
Definition: vfs.h:254
A file system needs to be declared using this macro for the VFS driver to be able to mount it using vfs_mount.
- Parameters
-
| fs_name | The name of the filesystem |
| fw_new | The function used to create a new instance of this filesystem |
◆ vfs_exist()
| static bool vfs_exist |
( |
const char * |
path | ) |
|
|
inlinestatic |
- Returns
- Whether a path exists in the current VFS.