pub struct DefragRangeArgs {
pub start: u64,
pub len: u64,
pub flush: bool,
pub extent_thresh: u32,
pub compress: Option<CompressSpec>,
pub nocomp: bool,
}Expand description
Arguments for a defragmentation operation.
Construct with DefragRangeArgs::new and use the builder methods to set
options. All options are optional; the defaults match the kernel’s defaults.
Fields§
§start: u64Start offset in bytes. Defaults to 0.
len: u64Number of bytes to defragment. Defaults to u64::MAX (the entire file).
flush: boolFlush dirty pages to disk immediately after defragmenting.
extent_thresh: u32Extents larger than this threshold are considered already defragmented
and will not be rewritten. 0 uses the kernel default (32 MiB as of
recent kernels). 1 forces every extent to be rewritten.
compress: Option<CompressSpec>Compress the file while defragmenting. None leaves the file’s
existing compression attribute unchanged.
nocomp: boolExplicitly disable compression during defragmentation (uncompress if
necessary). Mutually exclusive with compress.
Implementations§
Source§impl DefragRangeArgs
impl DefragRangeArgs
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new DefragRangeArgs with all defaults: defragment the
entire file, no compression change, no flush.
Sourcepub fn extent_thresh(self, thresh: u32) -> Self
pub fn extent_thresh(self, thresh: u32) -> Self
Set the extent size threshold. Extents larger than this will not be rewritten.
Sourcepub fn compress(self, spec: CompressSpec) -> Self
pub fn compress(self, spec: CompressSpec) -> Self
Compress the file using the given algorithm while defragmenting.
Trait Implementations§
Source§impl Clone for DefragRangeArgs
impl Clone for DefragRangeArgs
Source§fn clone(&self) -> DefragRangeArgs
fn clone(&self) -> DefragRangeArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more