pub struct MountTable {
mounts: SpinLock<BTreeMap<String, Vec<Arc<MountPoint>>>>,
}Expand description
全局挂载表
Fields§
§mounts: SpinLock<BTreeMap<String, Vec<Arc<MountPoint>>>>挂载路径 -> 挂载点栈(最后一个是当前可见的)
Implementations§
Source§impl MountTable
impl MountTable
Sourcepub fn mount(
&self,
fs: Arc<dyn FileSystem>,
path: &str,
flags: MountFlags,
device: Option<String>,
) -> Result<(), FsError>
pub fn mount( &self, fs: Arc<dyn FileSystem>, path: &str, flags: MountFlags, device: Option<String>, ) -> Result<(), FsError>
挂载文件系统
Sourcepub fn find_mount(&self, path: &str) -> Option<Arc<MountPoint>>
pub fn find_mount(&self, path: &str) -> Option<Arc<MountPoint>>
查找给定路径的挂载点
返回最长匹配的挂载点(栈顶)
Sourcepub fn root_mount(&self) -> Option<Arc<MountPoint>>
pub fn root_mount(&self) -> Option<Arc<MountPoint>>
获取根挂载点
Sourcepub fn list_mounts(&self) -> Vec<(String, String)>
pub fn list_mounts(&self) -> Vec<(String, String)>
列出所有挂载点(用于调试)