axfs/fs/myfs.rs
1use crate::dev::Disk;
2use alloc::sync::Arc;
3use axfs_vfs::VfsOps;
4
5/// The interface to define custom filesystems in user apps.
6#[crate_interface::def_interface]
7pub trait MyFileSystemIf {
8 /// Creates a new instance of the filesystem with initialization.
9 ///
10 /// TODO: use generic disk type
11 fn new_myfs(disk: Disk) -> Arc<dyn VfsOps>;
12}
13
14pub(crate) fn new_myfs(disk: Disk) -> Arc<dyn VfsOps> {
15 crate_interface::call_interface!(MyFileSystemIf::new_myfs(disk))
16}