pub enum PartitionIoRequest {
GetPartitionSize {
partition: String,
responder: PartitionIoGetPartitionSizeResponder,
},
ReadPartition {
partition: String,
offset: u64,
size: u64,
responder: PartitionIoReadPartitionResponder,
},
WritePartition {
partition: String,
offset: u64,
payload: Vmo,
trailing: TrailingBehavior,
responder: PartitionIoWritePartitionResponder,
},
Flush {
responder: PartitionIoFlushResponder,
},
}Expand description
Protocol for reading and writing raw boot partitions backed by a caller-provided block directory.
All partition lookups and I/O operations performed through this protocol are scoped to the
block_dir directory capability supplied by the caller in Paver.OpenPartitionIo. If a
requested partition is not present in block_dir, operations return ZX_ERR_NOT_FOUND.
Variants§
GetPartitionSize
Returns the size in bytes of a raw partition by name.
ReadPartition
Reads size bytes from a raw partition by name starting at offset.
Both offset and size may be arbitrary byte values and do not need to be aligned to the
partition’s block size. The ZX_PROP_VMO_CONTENT_SIZE property on the returned payload
VMO will be set to size.
Returns ZX_ERR_INVALID_ARGS if size is 0, or ZX_ERR_OUT_OF_RANGE if offset + size
exceeds the partition size.
WritePartition
Writes payload to a raw partition by name starting at offset.
The number of bytes to write is read from the ZX_PROP_VMO_CONTENT_SIZE property of
payload. Both offset and the write size may be arbitrary byte values and do not need to
be aligned to the partition’s block size.
Any leading partial block (when offset is not block-aligned) is always updated via
read-modify-write to preserve existing bytes prior to offset. Behavior for partition
contents after offset + size is controlled by trailing.
On some platforms, written data may be buffered in memory and is not guaranteed to be
persisted to storage until Flush is called.
Returns ZX_ERR_OUT_OF_RANGE if offset + size exceeds the partition size.
Flush
Flushes all previous WritePartition operations to persistent storage.
Callers must invoke Flush after completing partition writes to ensure that any buffered
data is persisted to storage.
Fields
responder: PartitionIoFlushResponderImplementations§
Source§impl PartitionIoRequest
impl PartitionIoRequest
pub fn into_get_partition_size( self, ) -> Option<(String, PartitionIoGetPartitionSizeResponder)>
pub fn into_read_partition( self, ) -> Option<(String, u64, u64, PartitionIoReadPartitionResponder)>
pub fn into_write_partition( self, ) -> Option<(String, u64, Vmo, TrailingBehavior, PartitionIoWritePartitionResponder)>
pub fn into_flush(self) -> Option<PartitionIoFlushResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL