From da83b75e40eba7852cf8ab5e71a39a0eb218330d Mon Sep 17 00:00:00 2001 From: Yato202010 <61349049+Yato202010@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:54:09 +0100 Subject: [PATCH] doc: fix typo + rework --- src/common/fs.rs | 8 ++--- src/os/linux/fuseoverlay/opt.rs | 2 +- src/os/linux/mod.rs | 8 ++--- src/os/linux/overlay/opt.rs | 55 ++++++++++++++++++++++---------- src/os/linux/unionfs_fuse/opt.rs | 2 +- 5 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/common/fs.rs b/src/common/fs.rs index edb716c..835a323 100644 --- a/src/common/fs.rs +++ b/src/common/fs.rs @@ -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 @@ -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 @@ -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>(path: P) -> Result; } diff --git a/src/os/linux/fuseoverlay/opt.rs b/src/os/linux/fuseoverlay/opt.rs index dd5ef48..489917f 100644 --- a/src/os/linux/fuseoverlay/opt.rs +++ b/src/os/linux/fuseoverlay/opt.rs @@ -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, diff --git a/src/os/linux/mod.rs b/src/os/linux/mod.rs index c1271f2..6a3ce94 100644 --- a/src/os/linux/mod.rs +++ b/src/os/linux/mod.rs @@ -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; - /// Check if mount option is incompatible + /// Check if a mount option is incompatible fn incompatible(&self, other: &MountOption) -> bool; } @@ -105,7 +105,7 @@ mod option { } impl MountOption { - /// Get defaults mount option for this filesystem + /// Get defaults mount options for this filesystem pub fn defaults() -> Vec { let mut v: Vec> = vec![]; let mut r = T::defaults(); @@ -113,7 +113,7 @@ mod option { v } - /// Check if mount option is incompatible + /// Check if a mount option is incompatible pub fn incompatible(&self, other: &MountOption) -> bool { match self { MountOption::FsSpecific(o) => o.incompatible(other), diff --git a/src/os/linux/overlay/opt.rs b/src/os/linux/overlay/opt.rs index c9e98bc..eb8dfa9 100644 --- a/src/os/linux/overlay/opt.rs +++ b/src/os/linux/overlay/opt.rs @@ -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 + /// For a detailed effect description of this option, + /// please refer to 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 diff --git a/src/os/linux/unionfs_fuse/opt.rs b/src/os/linux/unionfs_fuse/opt.rs index fb02554..317c1fd 100644 --- a/src/os/linux/unionfs_fuse/opt.rs +++ b/src/os/linux/unionfs_fuse/opt.rs @@ -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, }