2 releases

0.1.1 Jul 18, 2024
0.1.0 Jul 18, 2024

#520 in Operating systems

Download history 396/week @ 2024-07-21 514/week @ 2024-07-28 190/week @ 2024-08-04 255/week @ 2024-08-11 128/week @ 2024-08-18 198/week @ 2024-08-25 359/week @ 2024-09-01 493/week @ 2024-09-08 251/week @ 2024-09-15 360/week @ 2024-09-22 134/week @ 2024-09-29 524/week @ 2024-10-06 1156/week @ 2024-10-13 780/week @ 2024-10-20 342/week @ 2024-10-27 91/week @ 2024-11-03

2,483 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

~205KB