Struct fuse_backend_rs::passthrough::Config
source · pub struct Config {Show 14 fields
pub entry_timeout: Duration,
pub attr_timeout: Duration,
pub cache_policy: CachePolicy,
pub writeback: bool,
pub root_dir: String,
pub xattr: bool,
pub do_import: bool,
pub no_open: bool,
pub no_opendir: bool,
pub killpriv_v2: bool,
pub inode_file_handles: bool,
pub no_readdir: bool,
pub seal_size: bool,
pub dax_file_size: Option<u64>,
}Expand description
Options that configure the behavior of the passthrough fuse file system.
Fields§
§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.
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.
cache_policy: CachePolicyThe caching policy the file system should use. See the documentation of CachePolicy for
more details.
writeback: boolWhether 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.
root_dir: StringThe 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.
inode_file_handles: boolWhether to use file handles to reference inodes. We need to be able to open file
descriptors for arbitrary inodes, and by default that is done by storing an O_PATH FD in
InodeData. Not least because there is a maximum number of FDs a process can have open
users may find it preferable to store a file handle instead, which we can use to open an FD
when necessary.
So this switch allows to choose between the alternatives: When set to false, InodeData
will store O_PATH FDs. Otherwise, we will attempt to generate and store a file handle
instead.
The default 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.
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.