pub struct MountTree {
pub root_mount: RwLock<Arc<MountPoint>>,
}
Expand description
Mount tree manager for VFS v2
Fields§
§root_mount: RwLock<Arc<MountPoint>>
Root mount point (can be updated when mounting at “/”)
Implementations§
Source§impl MountTree
impl MountTree
Sourcepub fn new(root_entry: VfsEntryRef) -> Self
pub fn new(root_entry: VfsEntryRef) -> Self
Create a new mount tree with the given root
Sourcepub fn bind_mount(
&self,
source_entry: VfsEntryRef,
target_entry: VfsEntryRef,
target_mount_point: Arc<MountPoint>,
) -> VfsResult<MountId>
pub fn bind_mount( &self, source_entry: VfsEntryRef, target_entry: VfsEntryRef, target_mount_point: Arc<MountPoint>, ) -> VfsResult<MountId>
Create a bind mount.
§Arguments
source_entry
- The VFS entry to be mounted.target_entry
- The VFS entry where the source will be mounted.target_mount_point
- The mount point containing the target entry.
Sourcepub fn mount(
&self,
target_entry: VfsEntryRef,
target_mount_point: Arc<MountPoint>,
filesystem: Arc<dyn FileSystemOperations>,
) -> VfsResult<MountId>
pub fn mount( &self, target_entry: VfsEntryRef, target_mount_point: Arc<MountPoint>, filesystem: Arc<dyn FileSystemOperations>, ) -> VfsResult<MountId>
Mount a filesystem at a specific entry in the mount tree.
Sourcepub fn replace_root(&self, new_root: Arc<MountPoint>)
pub fn replace_root(&self, new_root: Arc<MountPoint>)
Replaces the root mount point.
Sourcepub fn is_mount_point(
&self,
entry_to_check: &VfsEntryRef,
mount_point_to_check: &Arc<MountPoint>,
) -> bool
pub fn is_mount_point( &self, entry_to_check: &VfsEntryRef, mount_point_to_check: &Arc<MountPoint>, ) -> bool
Sourcepub fn is_bind_source(&self, entry_to_check: &VfsEntryRef) -> bool
pub fn is_bind_source(&self, entry_to_check: &VfsEntryRef) -> bool
Check if an entry is a source for a bind mount
Sourcepub fn is_entry_used_in_mount(
&self,
entry_to_check: &VfsEntryRef,
mount_point_to_check: &Arc<MountPoint>,
) -> bool
pub fn is_entry_used_in_mount( &self, entry_to_check: &VfsEntryRef, mount_point_to_check: &Arc<MountPoint>, ) -> bool
Check if an entry is used in a mount (either as a mount point or a bind source)
Sourcepub fn unmount(
&self,
entry: &VfsEntryRef,
parent_mount_point: &Arc<MountPoint>,
) -> VfsResult<Arc<MountPoint>>
pub fn unmount( &self, entry: &VfsEntryRef, parent_mount_point: &Arc<MountPoint>, ) -> VfsResult<Arc<MountPoint>>
Unmount a filesystem
Sourcepub fn resolve_path(
&self,
path: &str,
) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
pub fn resolve_path( &self, path: &str, ) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
Resolve a path to a VFS entry, handling mount boundaries
Sourcepub fn resolve_mount_point(
&self,
path: &str,
) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
pub fn resolve_mount_point( &self, path: &str, ) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
Resolve a path to the mount point entry (not the mounted content) This is used for unmount operations where we need the actual mount point
Sourcepub fn resolve_path_with_options(
&self,
path: &str,
options: &PathResolutionOptions,
) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
pub fn resolve_path_with_options( &self, path: &str, options: &PathResolutionOptions, ) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
Resolve a path with specified options
Sourcepub fn resolve_mount_point_with_options(
&self,
path: &str,
options: &PathResolutionOptions,
) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
pub fn resolve_mount_point_with_options( &self, path: &str, options: &PathResolutionOptions, ) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
Resolve a path to the mount point entry with options
fn resolve_path_internal( &self, path: &str, resolve_mount: bool, options: &PathResolutionOptions, ) -> VfsResult<(VfsEntryRef, Arc<MountPoint>)>
Sourcefn resolve_component_no_symlink(
&self,
entry: VfsEntryRef,
component: &str,
) -> VfsResult<VfsEntryRef>
fn resolve_component_no_symlink( &self, entry: VfsEntryRef, component: &str, ) -> VfsResult<VfsEntryRef>
Resolve a single path component without following symlinks
Sourcepub fn parse_path(&self, path: &str) -> Vec<String>
pub fn parse_path(&self, path: &str) -> Vec<String>
Parse a path into components
Sourcefn get_mount_path(&self, mount: &Arc<MountPoint>) -> String
fn get_mount_path(&self, mount: &Arc<MountPoint>) -> String
Get the full path of a mount point
Sourcefn resolve_component(
&self,
entry: VfsEntryRef,
component: &str,
) -> VfsResult<VfsEntryRef>
fn resolve_component( &self, entry: VfsEntryRef, component: &str, ) -> VfsResult<VfsEntryRef>
Resolve a single path component within a VFS entry
Sourcefn resolve_component_with_depth(
&self,
entry: VfsEntryRef,
component: &str,
symlink_depth: u32,
) -> VfsResult<VfsEntryRef>
fn resolve_component_with_depth( &self, entry: VfsEntryRef, component: &str, symlink_depth: u32, ) -> VfsResult<VfsEntryRef>
Resolve a single path component with symlink depth tracking
Sourcefn resolve_symlink_target(
&self,
base_entry: &VfsEntryRef,
target: &str,
) -> VfsResult<VfsEntryRef>
fn resolve_symlink_target( &self, base_entry: &VfsEntryRef, target: &str, ) -> VfsResult<VfsEntryRef>
Resolve a symbolic link target
Sourcefn resolve_symlink_target_with_depth(
&self,
base_entry: &VfsEntryRef,
target: &str,
symlink_depth: u32,
) -> VfsResult<VfsEntryRef>
fn resolve_symlink_target_with_depth( &self, base_entry: &VfsEntryRef, target: &str, symlink_depth: u32, ) -> VfsResult<VfsEntryRef>
Resolve a symbolic link target with depth tracking