2 releases

0.1.1 Jul 18, 2024
0.1.0 Jul 18, 2024

#464 in Filesystem

Download history 506/week @ 2024-07-18 483/week @ 2024-07-25 356/week @ 2024-08-01 200/week @ 2024-08-08 194/week @ 2024-08-15 191/week @ 2024-08-22 270/week @ 2024-08-29

871 downloads per month
Used in 2 crates

GPL-3.0-or-later OR Apache-2…

22KB
404 lines

axfs_crates

CI

Crates for building filesystems:


lib.rs:

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:

Operation Description file/directory
open() Do something when the node is opened both
release() Do something when the node is closed both
get_attr() Get the attributes of the node both
read_at() Read data from the file file
write_at() Write data to the file file
fsync() Synchronize the file data to disk file
truncate() Truncate the file file
parent() Get the parent directory directory
lookup() Lookup the node with the given path directory
create() Create a new node with the given path directory
remove() Remove the node with the given path directory
read_dir() Read directory entries directory

Dependencies

~210KB