pub struct Config {Show 22 fields
pub attr_timeout: Duration,
pub entry_timeout: Duration,
pub dir_attr_timeout: Option<Duration>,
pub dir_entry_timeout: Option<Duration>,
pub cache_policy: CachePolicy,
pub writeback: bool,
pub root_dir: PathBuf,
pub xattr: bool,
pub do_import: bool,
pub no_open: bool,
pub no_opendir: bool,
pub killpriv_v2: bool,
pub no_readdir: bool,
pub seal_size: bool,
pub enable_mntid: bool,
pub dax_file_size: Option<u64>,
pub use_host_ino: bool,
pub allow_direct_io: bool,
pub use_mmap: bool,
pub max_mmap_size: u64,
pub mapping: IdMappings,
pub whiteout_format: WhiteoutFormat,
}Expand description
Options that configure the behavior of the passthrough fuse file system.
Fields§
§attr_timeout: DurationHow long the FUSE client should consider file and directory attributes to be valid. If the attributes of a file or directory can only be modified by the FUSE client (i.e., the file system has exclusive access), then this should be set to a large value.
The default value for this option is 5 seconds.
entry_timeout: DurationHow long the FUSE client should consider directory entries to be valid. If the contents of a directory can only be modified by the FUSE client (i.e., the file system has exclusive access), then this should be a large value.
The default value for this option is 5 seconds.
dir_attr_timeout: Option<Duration>Same as attr_timeout, override attr_timeout config, but only take effect on directories
when specified. This is useful to set different timeouts for directories and regular files.
dir_entry_timeout: Option<Duration>Same as entry_timeout, override entry_timeout config, but only take effect on
directories when specified. This is useful to set different timeouts for directories and
regular files.
cache_policy: CachePolicyThe caching policy the file system should use. See the documentation of CachePolicy for
more details.
writeback: boolWhether the file system should enable writeback caching. This can improve performance as it
allows the FUSE client to cache and coalesce multiple writes before sending them to the file
system. However, enabling this option can increase the risk of data corruption if the file
contents can change without the knowledge of the FUSE client (i.e., the server does NOT
have exclusive access). Additionally, the file system should have read access to all files
in the directory it is serving as the FUSE client may send read requests even for files
opened with O_WRONLY.
Therefore callers should only enable this option when they can guarantee that: 1) the file system has exclusive access to the directory and 2) the file system has read permissions for all files in that directory.
The default value for this option is false.
root_dir: PathBufThe path of the root directory.
The default is /.
xattr: boolWhether the file system should support Extended Attributes (xattr). Enabling this feature may have a significant impact on performance, especially on write parallelism. This is the result of FUSE attempting to remove the special file privileges after each write request.
The default value for this options is false.
do_import: boolTo be compatible with Vfs and PseudoFs, PassthroughFs needs to prepare root inode before accepting INIT request.
The default value for this option is true.
no_open: boolControl whether no_open is allowed.
The default value for this option is false.
no_opendir: boolControl whether no_opendir is allowed.
The default value for this option is false.
killpriv_v2: boolControl whether kill_priv_v2 is enabled.
The default value for this option is false.
no_readdir: boolControl whether readdir/readdirplus requests return zero dirent to client, as if the directory is empty even if it has children.
seal_size: boolControl whether to refuse operations which modify the size of the file. For a share memory file mounted from host, seal_size can prohibit guest to increase the size of share memory file to attack the host.
enable_mntid: boolWhether count mount ID or not when comparing two inodes. By default we think two inodes
are same if their inode number and st_dev are the same. When enable_mntid is set as
‘true’, inode’s mount ID will be taken into account as well. For example, bindmount the
same file into virtiofs’ source dir, the two bindmounted files will be identified as two
different inodes when this option is true, so the don’t share pagecache.
The default value for this option is false.
dax_file_size: Option<u64>What size file supports dax
- If dax_file_size == None, DAX will disable to all files.
- If dax_file_size == 0, DAX will enable all files.
- If dax_file_size == N, DAX will enable only when the file size is greater than or equal to N Bytes.
use_host_ino: boolReduce memory consumption by directly use host inode when possible.
When set to false, a virtual inode number will be allocated for each file managed by
the passthroughfs driver. A map is used to maintain the relationship between virtual
inode numbers and host file objects.
When set to true, the host inode number will be directly used as virtual inode number
if it’s less than the threshold (1 << 47), so reduce memory consumed by the map.
A virtual inode number will still be allocated and maintained if the host inode number
is bigger than the threshold.
The default value for this option is false.
allow_direct_io: boolWhether the file system should honor the O_DIRECT flag. If this option is disabled,
that flag will be filtered out at open_inode.
The default is true.
use_mmap: bool§max_mmap_size: u64The size of the mmap max usage
The default is 1024 * 1024 * 1024 (1GB).
mapping: IdMappingsUID/GID mapping. Format: uidmapping=H:T:L[:H2:T2:L2...],gidmapping=H:T:L[:H2:T2:L2...]
whiteout_format: WhiteoutFormatWhiteout format used when this passthrough is layered under overlayfs/unionfs.
Defaults to CharDev on Linux (kernel-overlayfs convention) and to
OciWhiteout on macOS (avoids the root requirement of mknod char dev).
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more