|
ginnOS
The reference: libc, the libraries and the kernel
|
VFS mount table. More...
Macros | |
| #define | VFS_MOUNT_MAX 8 |
Functions | |
| kerr_t | vfs_mount (const char *prefix, fs_mount_t *mount) |
| mount a filesystem at a path prefix. | |
| kerr_t | vfs_umount (const char *prefix) |
| unmount the filesystem at an exact path prefix. | |
| bool | vfs_mount_at (uint32_t index, char *prefix_out, uint32_t prefix_size, fs_mount_t **mount_out) |
| a mounted filesystem, by its place in the mount table (for /proc/mounts). | |
| fs_mount_t * | vfs_resolve_mount_path (const char *path, const char **rel_out) |
| find the mounted filesystem responsible for an absolute path, and the sub-path relative to that mount's prefix. | |
| kerr_t | vfs_mount_root (fs_mount_t *mount) |
| mount a filesystem as the root filesystem. | |
VFS mount table.
holds the set of mounted filesystems keyed by path prefix. path-based operations resolve a path to the mount whose prefix is the longest match, so "/" (the root) catches everything not claimed by a more specific mount like "/dev" or "/proc". today only root is mounted, but the table makes additional pseudo-filesystems a matter of calling vfs_mount().
| #define VFS_MOUNT_MAX 8 |
| kerr_t vfs_mount | ( | const char * | prefix, |
| fs_mount_t * | mount ) |
mount a filesystem at a path prefix.
a later, more specific prefix takes precedence over a shorter one during path resolution (e.g. "/dev" wins over "/"). remounting an existing prefix replaces its backing filesystem.
| prefix | absolute mount point, e.g. "/" or "/dev". |
| mount | the filesystem to mount there (must already be mounted). |
| kerr_t vfs_umount | ( | const char * | prefix | ) |
unmount the filesystem at an exact path prefix.
| prefix | the mount point to remove. |
| bool vfs_mount_at | ( | uint32_t | index, |
| char * | prefix_out, | ||
| uint32_t | prefix_size, | ||
| fs_mount_t ** | mount_out ) |
a mounted filesystem, by its place in the mount table (for /proc/mounts).
| index | 0, 1, ... the entries in the order they were mounted. |
| prefix_out | gets the mount point. |
| mount_out | gets the filesystem. |
| fs_mount_t * vfs_resolve_mount_path | ( | const char * | path, |
| const char ** | rel_out ) |
find the mounted filesystem responsible for an absolute path, and the sub-path relative to that mount's prefix.
the backing filesystem is handed a path relative to its own mount point, not the full absolute path: the root mount "/" sees the path unchanged (still leading '/'), while a sub-mount at "/dev" sees "/fb0" for "/dev/fb0" and "/" for "/dev" itself. the relative path always keeps a leading '/'.
| path | absolute path to resolve. |
| rel_out | if non-NULL, receives a pointer into path (or a static "/") for the mount-relative sub-path. only valid while path is. |
| kerr_t vfs_mount_root | ( | fs_mount_t * | mount | ) |
mount a filesystem as the root filesystem.
convenience wrapper for vfs_mount("/", mount).
| mount | pointer to the filesystem mount structure to be used as the root filesystem. |