pub struct MountPoint {
pub path: String,
pub fs: FileSystemRef,
pub fs_id: usize,
pub mount_type: MountType,
pub mount_options: MountOptions,
pub parent: Option<String>,
pub children: Vec<String>,
pub mount_time: u64,
}
Expand description
Extended mount point information
MountPoint contains comprehensive information about a mounted filesystem, including metadata, mount options, and relationship information for hierarchical mount management.
§Features
- Filesystem Integration: Direct reference to the mounted filesystem
- Mount Hierarchy: Parent/child relationships for mount tree management
- Security Options: Configurable mount options for access control
- Bind Mount Support: Resolves bind mount chains to actual filesystems
- Metadata Tracking: Mount time and filesystem identification
§Thread Safety
MountPoint is designed to be shared safely between threads using Arc wrapper when stored in the mount tree.
Fields§
§path: String
Absolute mount path in the filesystem hierarchy
fs: FileSystemRef
Reference to the actual filesystem implementation
fs_id: usize
VfsManager-assigned filesystem identifier
mount_type: MountType
Type of mount (regular, bind, overlay)
mount_options: MountOptions
Security and behavior options for this mount
parent: Option<String>
Parent mount path (None for root mount)
children: Vec<String>
List of child mount paths
mount_time: u64
Timestamp when this mount was created
Implementations§
Source§impl MountPoint
impl MountPoint
Sourcepub fn resolve_fs(&self, relative_path: &str) -> Result<(FileSystemRef, String)>
pub fn resolve_fs(&self, relative_path: &str) -> Result<(FileSystemRef, String)>
Resolve filesystem and internal path from MountPoint
This method resolves bind mount chains to find the actual filesystem that handles the requested path. For regular mounts, it returns the filesystem directly. For bind mounts, it recursively follows the bind chain to the source filesystem.
§Arguments
relative_path
- Path relative to this mount point
§Returns
Ok((FileSystemRef, String))
- The actual filesystem and the resolved path within itErr(FileSystemError)
- If bind mount resolution fails or exceeds recursion limit
§Note
This method only supports Regular, Tmpfs, and Overlay mounts. Bind mounts are resolved transparently to their source filesystems.
Sourcefn resolve_fs_with_depth(
&self,
relative_path: &str,
depth: usize,
) -> Result<(FileSystemRef, String)>
fn resolve_fs_with_depth( &self, relative_path: &str, depth: usize, ) -> Result<(FileSystemRef, String)>
Internal method for bind mount resolution with recursion depth tracking
This method prevents infinite recursion in circular bind mount chains by limiting the maximum recursion depth to 32 levels.
§Arguments
relative_path
- Path relative to this mount pointdepth
- Current recursion depth for loop detection
§Returns
Ok((FileSystemRef, String))
- The actual filesystem and resolved pathErr(FileSystemError)
- If recursion limit exceeded or resolution fails
Trait Implementations§
Source§impl Clone for MountPoint
impl Clone for MountPoint
Source§fn clone(&self) -> MountPoint
fn clone(&self) -> MountPoint
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MountPoint
impl !RefUnwindSafe for MountPoint
impl Send for MountPoint
impl Sync for MountPoint
impl Unpin for MountPoint
impl !UnwindSafe for MountPoint
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit
)