pub struct Config {
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,
}
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
Trait Implementations§
source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Config
impl PartialEq for Config
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin 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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.