Expand description
Coordinates pager-backed blob VMOs, driver-level page fault handling, and cryptographic verification.
§Overview
BlobPagerAndVerifier manages pager-backed VMOs for blobs. It decouples page fault servicing
from the filesystem by having the block driver read and decompress raw disk blocks directly,
while BlobPagerAndVerifier cryptographically verifies the pages before supplying them to
the pager VMO to unblock client reads.
§Blob Opening and Caching
When a client requests a blob via create_vmo:
- If already cached: Clones and returns a new read-only child VMO immediately.
- If currently opening: Suspends until the in-flight request finishes, then clones and returns a child VMO once ready.
- If not in cache: Registers the blob’s extent mappings with Fxfs, creates the pager-backed VMO, caches it, and returns a child VMO to the caller.
§Page Fault Handling and Verification
- When a client reads an unpopulated page, the kernel generates a page request on the pager port, which the block driver monitors directly.
- The driver reads and decompresses the disk blocks according to the blob’s extent mappings, then writes unverified pages and Merkle metadata into a shared delivery queue VMO.
BlobPagerAndVerifierverifies the incoming pages against the blob’s Merkle tree:- On success, it supplies the verified pages to the pager VMO (
zx_pager_supply_pages), unblocking the client read. - On verification failure, it fails the request with
ZX_ERR_IO_DATA_INTEGRITY.
- On success, it supplies the verified pages to the pager VMO (
§Eviction and Teardown
- Clients receive read-only child VMOs cloned from the parent pager VMO.
- When all client handles to a blob are dropped, the kernel notifies the cache via
ZX_VMO_ZERO_CHILDREN. - The cache evicts the inactive blob and closes its mapping session with Fxfs, reclaiming driver extent tracking and kernel pager resources.
Structs§
- Blob
Pager AndVerifier - Coordinates between FxBlob, the block driver, and the kernel to manage pager-backed blobs such that page requests can be handled at the driver instead of the filesystem layer.
- Delivery
Queue Processor - Test
VmoProvider - A simple in-memory
DeliveryQueueProviderfor testing delivery without Merkle verification. - Unverified
Pages - Unverified data pages delivered from the driver to be verified.
Constants§
- 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).
Traits§
- Delivery
Queue Provider - Trait providing data delivery and blob metadata registration for incoming delivery commands.