Crate axfs_vfs

source ·
Expand description

Virtual filesystem interfaces used by ArceOS.

A filesystem is a set of files and directories (symbol links are not supported currently), collectively referred to as nodes, which are conceptually similar to inodes in Linux. A file system needs to implement the VfsOps trait, its files and directories need to implement the VfsNodeOps trait.

The VfsOps trait provides the following operations on a filesystem:

  • mount(): Do something when the filesystem is mounted.
  • umount(): Do something when the filesystem is unmounted.
  • format(): Format the filesystem.
  • statfs(): Get the attributes of the filesystem.
  • root_dir(): Get root directory of the filesystem.

The VfsNodeOps trait provides the following operations on a file or a directory:

OperationDescriptionfile/directory
open()Do something when the node is openedboth
release()Do something when the node is closedboth
get_attr()Get the attributes of the nodeboth
read_at()Read data from the filefile
write_at()Write data to the filefile
fsync()Synchronize the file data to diskfile
truncate()Truncate the filefile
parent()Get the parent directorydirectory
lookup()Lookup the node with the given pathdirectory
create()Create a new node with the given pathdirectory
remove()Remove the node with the given pathdirectory
read_dir()Read directory entriesdirectory

Modules

  • Utilities for path manipulation.

Macros

Structs

Enums

Traits

Type Aliases