Module vfs

Source
Expand description

A union file system which combines multiple backend file systems into one.

A simple union file system with limited functionality, which

  1. uses pseudo fs to maintain the directory structures
  2. supports mounting a file system at “/” or and subdirectory
  3. supports mounting multiple file systems at different paths
  4. remounting another file system at the same path will evict the old one
  5. doesn’t support recursive mounts. If /a is a mounted file system, you can’t mount another file systems under /a.

Its main usage is to avoid virtio-fs device hotplug. With this simple union fs, a new backend file system could be mounted onto a subdirectory, instead of hot-adding another virtio-fs device. This is very convenient to manage container images at runtime.

Structs§

Vfs
A union fs that combines multiple backend file systems.
VfsInode
Data struct to store inode number for the VFS filesystem.
VfsOptions
vfs init options

Enums§

VfsError
Vfs error definition

Constants§

CURRENT_DIR_CSTR
Current directory
EMPTY_CSTR
Emptry CSTR
PARENT_DIR_CSTR
Parent directory
PROC_SELF_FD_CSTR
Proc fd directory
SLASH_ASCII
ASCII for slash(‘/’)
VFS_MAX_INO
Maximum inode number supported by the VFS for backend file system

Traits§

BackendFileSystem
BackendFileSystem abstracts all backend file systems under vfs

Functions§

validate_path_component
Validate a path component. A well behaved FUSE client should never send dot, dotdot and path components containing slash (‘/’). The only exception is that LOOKUP might contain dot and dotdot to support NFS export.

Type Aliases§

BackFileSystem
Type that implements BackendFileSystem and Sync and Send
VfsIndex
Vfs backend file system index
VfsResult
Vfs result