Skip to content

Commit

Permalink
doc: fix typo + rework
Browse files Browse the repository at this point in the history
  • Loading branch information
Yato202010 committed Nov 13, 2024
1 parent f4be146 commit da83b75
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/common/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait Filesystem: Sized {

/// Retrieve the partition Identifier
/// "dev id" on UNIX and "volume serial number" on Windows
/// if the partition is not mounted, it will return None
/// if the partition isn't mounted, it'll return None
fn id(&self) -> Option<&PartitionID>;

/// Retrieve the mount point as PathBuf
Expand All @@ -42,7 +42,7 @@ pub trait Filesystem: Sized {
}
}

/// Common trait for all stackable/union/overlay filesystem handle
/// Common trait for all stackable/union/overlay filesystem handles
#[allow(dead_code)]
pub trait StackableFilesystem: Filesystem {
/// Retrieve a list of lower layer
Expand All @@ -63,9 +63,9 @@ pub trait StackableFilesystem: Filesystem {
pub trait CaseInsensitive: Filesystem {}

/// Common trait for all filesystem handles that can be recovered by using system information
/// ex: /etc/mtab on Linux, etc...
/// ex: /etc/mtab on Linux, etc.
#[allow(dead_code)]
pub trait StateRecovery: Filesystem {
/// Recover filesystem handle from system information
/// Recover a filesystem handle from system information
fn recover<P: AsRef<Path>>(path: P) -> Result<Self>;
}
2 changes: 1 addition & 1 deletion src/os/linux/fuseoverlay/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub enum FuseOverlayFsOption {
/// Every file and directory is owned by the specified gid.
/// It has higher precedence over squash_to_root.
SquashToGid(usize),
/// Set st_nlink to the static value 1 for all directories
/// Set st_nlink to static value 1 for all directories
StaticNLink,
/// Disable ACL support in the FUSE file system
NoAcl,
Expand Down
8 changes: 4 additions & 4 deletions src/os/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ mod option {
}

pub trait FsOption: Sized + Clone + Display + FromStr {
/// Get defaults mount option for this filesystem
/// Get defaults mount options for this filesystem
fn defaults() -> Vec<Self>;
/// Check if mount option is incompatible
/// Check if a mount option is incompatible
fn incompatible(&self, other: &MountOption<Self>) -> bool;
}

Expand All @@ -105,15 +105,15 @@ mod option {
}

impl<T: FsOption> MountOption<T> {
/// Get defaults mount option for this filesystem
/// Get defaults mount options for this filesystem
pub fn defaults() -> Vec<Self> {
let mut v: Vec<MountOption<T>> = vec![];
let mut r = T::defaults();
v.extend(r.iter_mut().map(|x| MountOption::FsSpecific(x.clone())));
v
}

/// Check if mount option is incompatible
/// Check if a mount option is incompatible
pub fn incompatible(&self, other: &MountOption<T>) -> bool {
match self {
MountOption::FsSpecific(o) => o.incompatible(other),
Expand Down
55 changes: 39 additions & 16 deletions src/os/linux/overlay/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,60 @@ pub enum OverlayFsOption {
/// ### On
/// Redirects are enabled.
/// ### Follow
/// Redirects are not created, but followed.
/// Redirects aren't created, but followed.
/// ### NoFollow
/// Redirects are not created and not followed.
/// Redirects aren't created and not followed.
/// ### Off
/// If “redirect_always_follow” is enabled in the kernel/module config, this “off” translates to “follow”, otherwise it translates to “nofollow”.
/// If “redirect_always_follow”
/// is enabled in the kernel/module config, this “off” translates to “follow”,
/// otherwise it translates to “nofollow”.
RedirectDir(RedirectDir),
/// When the “metacopy” feature is enabled, overlayfs will only copy up metadata (as opposed to whole file)
/// When the “metacopy” feature is enabled, overlayfs will only copy up metadata
/// (as opposed to a whole file)
Metacopy(bool),
/// ### On
/// Whenever a metacopy files specifies an expected digest, the corresponding data file must match the specified digest. When generating a metacopy file the verity digest will be set in it based on the source file (if it has one).
/// Whenever metacopy files specify an expected digest,
/// the corresponding data file must match the specified digest.
/// When generating a metacopy file, the verity digest will be set in it based on the source file
/// (if it has one).
/// ### Require
/// Same as “on”, but additionally all metacopy files must specify a digest (or EIO is returned on open). This means metadata copy up will only be used if the data file has fs-verity enabled, otherwise a full copy-up is used.
/// Same as “on”, but additionally, all metacopy files must specify a digest
/// (or EIO is returned on open).
/// This means metadata copy up will only be used if the data file has fs-verity enabled,
/// otherwise a full copy-up is used.
/// ###• Off
/// The metacopy digest is never generated or used. This is the default if verity option is not specified.
/// The metacopy digest is never generated or used.
/// This is the default if verity option isn't specified.
FsVerity(FsVerity),
/// Inode index. If this feature is disabled and a file with multiple hard links is copied up, then this will "break" the link. Changes will not be propagated to other names referring to the same inode.
/// Inode index.
/// If this feature is turned off and a file with multiple hard links is copied up,
/// then this will "break" the link.
/// Changes won't be propagated to other names referring to the same inode.
Index(bool),
/// Can be used to replace UUID of the underlying filesystem in file handles with null, and effectively disable UUID checks. This can be useful in case the
/// underlying disk is copied and the UUID of this copy is changed. This is only applicable if
/// Can be used to replace UUID of the underlying filesystem in file handles with null,
/// and effectively turn off UUID checks.
/// This can be useful in case the
/// underlying disk is copied and the UUID of this copy is changed.
/// This is only applicable if
/// all lower/upper/work directories are on the same filesystems,
/// otherwise it will fallback to normal behaviour.
/// otherwise it'll fall back to normal behaviour.
Uuid(bool),
/// The "xino" feature composes a unique object identifier from the real object st_ino and an underlying fsid index. The "xino" feature uses the high inode number
/// bits for fsid, because the underlying filesystems rarely use the high inode number bits. In case the underlying inode number does overflow into the high xino
/// The "xino"
/// feature composes a unique object identifier from the real object st_ino and an underlying fsid index.
/// The "xino" feature uses the high inode number
/// bits for fsid, because the underlying filesystems rarely use the high inode number bits.
/// In case the underlying inode number does overflow into the high xino
/// bits, overlay filesystem will fall back to the non xino behavior for that inode.
///
/// For a detailed description of the effect of this option please refer to <https://docs.kernel.org/filesystems/overlayfs.html>
/// For a detailed effect description of this option,
/// please refer to <https://docs.kernel.org/filesystems/overlayfs.html>
Xino(Xino),
/// Use the "user.overlay." xattr namespace instead of "trusted.overlay.". This is useful for unprivileged mounting of overlayfs.
/// Use the "user.overlay."
/// Xattr namespace instead of "trusted.overlay."
/// This is useful for unprivileged mounting of overlayfs.
UserXattr,
/// Volatile mounts are not guaranteed to survive a crash. It is strongly recommended that volatile mounts are only used if data written to the overlay can be
/// Volatile mounts aren't guaranteed to survive a crash.
/// It is strongly recommended that volatile mounts are only used if data written to the overlay can be
/// recreated without significant effort.
Volatile,
// TODO : check doc and incompatibility
Expand Down
2 changes: 1 addition & 1 deletion src/os/linux/unionfs_fuse/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum UnionFsFuseOption {
RelaxedPermission,
/// Do not count blocks of ro-branches
StatfsOmitRo,
/// Enable direct-io flag for fuse subsystem
/// Enable direct-io flag for the fuse subsystem
DirectIo,
}

Expand Down

0 comments on commit da83b75

Please sign in to comment.