Struct devices::virtio::fs::config::Config

source ·
pub struct Config {
Show 13 fields pub timeout: Duration, pub negative_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, pub max_dynamic_perm: usize, pub max_dynamic_xattr: usize, pub security_ctx: bool, pub ugid_map: Vec<PermissionData>,
}
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.

§negative_timeout: Duration

How long the FUSE client can cache negative lookup results. If a file lookup fails, the client can assume the file doesn’t exist until the timeout and won’t send lookup. The value 0 means that negative lookup shouldn’t be cached.

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 0 seconds (= no negative cache).

§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.

§max_dynamic_perm: usize§max_dynamic_xattr: usize§security_ctx: bool§ugid_map: Vec<PermissionData>

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Config

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromArgValue for Config

source§

fn from_arg_value(value: &str) -> Result<Self, String>

Construct the type from a commandline value, returning an error string on failure.
source§

impl PartialEq for Config

source§

fn eq(&self, other: &Config) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Config

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Config

source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

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.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,