Expand description
This module defines the communication protocol over the VMOs shared between the filesystem
(Fxfs), the block driver (block_server), and the client/verifier (e.g., pkg-cache). The
two VMOs (mapping queue and delivery queue) are provided to
fuchsia.storage.block/Mapper.OpenSession to initialize a session.
Two main channels of communication exist for paging:
-
Mapping Queue (
RawMappingCommand): Direction: Filesystem (Fxfs) -> Driver (Established via the client during initialization) Purpose: The filesystem informs the driver of where a file resides on the storage device (its extents). When the driver receives a page fault from the kernel for a specifickey, it consults this mapping to know which blocks to read from disk. -
Delivery Queue (
RawDeliveryCommand): Direction: Driver -> Client/Verifier (e.g.,pkg-cache, which also acts as the Pager) Purpose: After the driver reads (and decompresses) the requested blocks, it writes the data into the delivery queue VMO and sends a delivery command. The verifier receives this command, cryptographically verifies the payload against the Merkle tree, and then supplies it to the kernel pager (zx_pager_supply_pages). The blob’s Merkle leaf data is also transported via the delivery queue when the driver fetches and caches the metadata.
Structs§
- RawDelivery
Command - A command packet used by the driver to deliver merkle leaves and data chunks for verification.
- RawMapping
Command - A command packet used to communicate extent mappings.
Enums§
Constants§
- CLOSE_
BLOB_ COMMAND - DELIVERY_
DATA_ COMMAND - DELIVERY_
DATA_ SIZE - The chunk size requirement for delivering payloads from the block driver across the delivery
queue. The driver must supply
DeliveryCommand::Datachunks where thetarget_offsetandlengthalign toDELIVERY_DATA_SIZEboundaries (unless representing the final chunk of the blob). - DELIVERY_
REGISTER_ BLOB_ COMMAND - DELIVERY_
VMO_ SIZE - ENCRYPTION_
KEY_ SIZE - Size of the encryption key in bytes (256 bits).
- MAPPINGS_
COMMAND - MAPPINGS_
FLAG_ ENCRYPTED - Flag indicating that the mapping payload contains an encryption key.
- MAPPING_
VMO_ SIZE - PENDING_
COMMANDS_ CAPACITY - PENDING_
DELIVERY_ COMMANDS_ CAPACITY