Crate disk_layered

Source
Expand description

A layered disk implementation, LayeredDisk.

A layered disk is a disk composed of multiple layers. Each layer is a block device made up of sectors, but with the added per-sector state of whether the sector is present or not. When reading a sector, the layered disk will read from the topmost layer that has the sector present. When writing, the disk will write to the topmost layer.

A layer can also have caching behavior. If a layer is configured to cache reads, then sectors that are read from lower layers are written back to the layer. If a layer is configured to write through, then writes are written to the layer and the next layer. These can be useful to implement simple persistent and non-persistent caches, primarily designed for lazily populating local backing stores from remote sources.

Missing from this implementation is write-back caching and cache eviction, which would be needed for caches that are smaller than the disk. These require potentially complicated cache management policies and are probably best implemented in a separate disk implementation.

Modules§

resolve
Resolver-related definitions for disk layer resources.
resolver
Resolvers for layered disks.

Structs§

DiskLayer
A single layer which can be attached to a LayeredDisk.
DiskLayerMetadata
Metadata of a particular layer, collected from various LayerIo APIs.
LayerConfiguration
A configuration for a layer in a LayeredDisk.
LayeredDisk
A disk composed of multiple layers.
SectorMarker
A type to mark sectors that have been read by a layer as part of a LayerIo::read operation.

Enums§

InvalidLayer
An error returned when creating a DiskLayer.
InvalidLayeredDisk
An error returned when creating a LayeredDisk.

Traits§

LayerAttach
Transition a layer from an unattached type-state, into an attached type-state, capable of performing LayerIo.
LayerIo
Metadata and IO for disk layers.
WriteNoOverwrite
Writes to the layer without overwriting existing data.