Skip to main content

file_extent_same

Function file_extent_same 

Source
pub fn file_extent_same(
    src_fd: BorrowedFd<'_>,
    src_offset: u64,
    length: u64,
    targets: &[DedupeTarget],
) -> Result<Vec<DedupeResult>>
Expand description

Deduplicate a source range against one or more destination ranges.

Compares length bytes starting at src_offset in the file referred to by src_fd against each target. Where data matches, the destination extents are replaced with shared references to the source extent.

Returns one DedupeResult per target, in the same order.

Errors (ioctl-level): EINVAL if src_offset or length are not sector-aligned, or if targets is empty. EPERM if the destination files are not writable.