Skip to main content

sector_read

Function sector_read 

Source
fn sector_read<D: BlockDevice>(
    dev: &D,
    offset: u64,
    buf: &mut [u8],
) -> Result<usize, BlockError>
Expand description

Read buf.len() bytes from the block device starting at byte offset.

For aligned multi-sector ranges, uses the bulk read_sectors method to submit a single I/O command. Partial starts/ends fall back to per-sector reads with a 512-byte bounce buffer.