pub struct Config {
    pub timeout: Duration,
    pub cache_policy: CachePolicy,
    pub writeback: bool,
    pub rewrite_security_xattrs: bool,
    pub ascii_casefold: bool,
    pub privileged_quota_uids: Vec<uid_t>,
    pub use_dax: bool,
    pub posix_acl: bool,
}
Expand description

Options that configure the behavior of the file system.

Fields§

§timeout: Duration

How long the FUSE client should consider directory entries and file/directory attributes to be valid. This value corresponds to entry_timeout and attr_timeout in libfuse’s fuse_config, but we use the same value for the two.

If the contents of a directory or 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 a large value. The default value for this option is 5 seconds.

§cache_policy: CachePolicy

The caching policy the file system should use. See the documentation of CachePolicy for more details.

§writeback: bool

Whether the file system should enabled 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.

§rewrite_security_xattrs: bool

Controls whether security.* xattrs (except for security.selinux) are re-written. When this is set to true, the server will add a “user.virtiofs” prefix to xattrs in the security namespace. Setting these xattrs requires CAP_SYS_ADMIN in the namespace where the file system was mounted and since the server usually runs in an unprivileged user namespace, it’s unlikely to have that capability.

The default value for this option is false.

§ascii_casefold: bool

Use case-insensitive lookups for directory entries (ASCII only).

The default value for this option is false.

§privileged_quota_uids: Vec<uid_t>§use_dax: bool

Use DAX for shared files.

Enabling DAX can improve performance for frequently accessed files by mapping regions of the file directly into the VM’s memory region, allowing direct access with the cost of slightly increased latency the first time the file is accessed. Additionally, since the mapping is shared directly from the host kernel’s file cache, enabling DAX can improve performance even when the cache policy is Never.

The default value for this option is false.

§posix_acl: bool

Enable support for POSIX acls.

Enable POSIX acl support for the shared directory. This requires that the underlying file system also supports POSIX acls.

The default value for this option is true.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.