pub struct VirtioBlockBackend;Expand description
Adapter that wraps the global virtio-blk device as a DiskBackend.
Translates 4KB BlockFS blocks into 512-byte virtio sector reads/writes.
Trait Implementations§
Source§impl DiskBackend for VirtioBlockBackend
impl DiskBackend for VirtioBlockBackend
Source§fn read_block(&self, block_num: u64, buf: &mut [u8]) -> Result<(), KernelError>
fn read_block(&self, block_num: u64, buf: &mut [u8]) -> Result<(), KernelError>
Read a single 4KB block from the disk. Read more
Source§fn write_block(&self, block_num: u64, data: &[u8]) -> Result<(), KernelError>
fn write_block(&self, block_num: u64, data: &[u8]) -> Result<(), KernelError>
Write a single 4KB block to the disk. Read more
Source§fn block_count(&self) -> u64
fn block_count(&self) -> u64
Total capacity in BlockFS-sized blocks (4KB each).
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Whether the device is read-only.