Skip to main content

discard_range

Function discard_range 

Source
pub fn discard_range(fd: BorrowedFd<'_>, offset: u64, length: u64) -> Result<()>
Expand description

Issue a BLKDISCARD (TRIM) on the given byte range of a block device.

Tells the device that the specified range is no longer in use and its contents can be discarded. This is typically done before repurposing a device (e.g. as a replace target).