Module syscall

Source
Expand description

VFS v2 System Call Interface

This module implements system call handlers for VFS v2, providing the user-space interface to filesystem operations. All system calls follow capability-based semantics and work with the task’s VFS namespace.

§Supported System Calls

§VFS Operations (400-series)

  • sys_vfs_open(): Open files and directories (VfsOpen 400)
  • sys_vfs_remove(): Unified remove for files/directories (VfsRemove 401)
  • sys_vfs_create_file(): Create regular files (VfsCreateFile 402)
  • sys_vfs_create_directory(): Create directories (VfsCreateDirectory 403)
  • sys_vfs_change_directory(): Change working directory (VfsChangeDirectory 404)
  • sys_vfs_truncate(): Truncate files by path (VfsTruncate 405)

§Filesystem Operations (500-series)

  • sys_fs_mount(): Mount filesystems (FsMount 500)
  • sys_fs_umount(): Unmount filesystems (FsUmount 501)
  • sys_fs_pivot_root(): Change root filesystem (FsPivotRoot 502)

§Utility Operations

  • (deprecated - use VfsCreateFile 402 instead)

§VFS Namespace Isolation

Each task can have its own VFS namespace (Option<Arc>). System calls operate within the task’s namespace, enabling containerization and process isolation.

§Error Handling

System calls return usize::MAX (-1) on error and appropriate values on success.

Functions§

create_filesystem_and_mount 🔒
Create a filesystem using the driver and mount it
parse_overlay_options 🔒
pivot_root_in_place 🔒
Pivot root by replacing the mount tree inside the existing VfsManager
sys_fs_mount
Mount a filesystem (FsMount)
sys_fs_pivot_root
This system call mounts a filesystem at the specified target path.
sys_fs_umount
Unmount a filesystem (FsUmount)
sys_vfs_change_directory
Change current working directory using VFS (VfsChangeDirectory)
sys_vfs_create_directory
Create a directory using VFS (VfsCreateDirectory)
sys_vfs_create_file
Create a regular file using VFS (VfsCreateFile)
sys_vfs_open
Open a file or directory using VFS (VfsOpen)
sys_vfs_remove
Remove a file or directory (unified VfsRemove)
sys_vfs_truncate
Truncate a file by path (VfsTruncate)
to_absolute_path_v2 🔒