pub enum VolumeRequest {
Show 13 variants
GetInfo {
responder: VolumeGetInfoResponder,
},
GetStats {
clear: bool,
responder: VolumeGetStatsResponder,
},
OpenSession {
session: ServerEnd<SessionMarker>,
control_handle: VolumeControlHandle,
},
OpenSessionWithOffsetMap {
session: ServerEnd<SessionMarker>,
offset_map: Option<ClientEnd<OffsetMapMarker>>,
initial_mappings: Option<Vec<BlockOffsetMapping>>,
control_handle: VolumeControlHandle,
},
GetTypeGuid {
responder: VolumeGetTypeGuidResponder,
},
GetInstanceGuid {
responder: VolumeGetInstanceGuidResponder,
},
GetName {
responder: VolumeGetNameResponder,
},
GetMetadata {
responder: VolumeGetMetadataResponder,
},
QuerySlices {
start_slices: Vec<u64>,
responder: VolumeQuerySlicesResponder,
},
GetVolumeInfo {
responder: VolumeGetVolumeInfoResponder,
},
Extend {
start_slice: u64,
slice_count: u64,
responder: VolumeExtendResponder,
},
Shrink {
start_slice: u64,
slice_count: u64,
responder: VolumeShrinkResponder,
},
Destroy {
responder: VolumeDestroyResponder,
},
}
Expand description
Volume is a partition which may access virtually-mapped blocks within a device.
Variants§
GetInfo
Get information about the underlying block device.
Fields
responder: VolumeGetInfoResponder
GetStats
Returns stats about block device operations. Setting clear
will reset stats counters.
OpenSession
Opens a new FIFO-based session on the block device.
OpenSessionWithOffsetMap
Opens a new FIFO-based session on the block device, providing an offset lookup map which transparently translates device offsets in block FIFO requests.
initial_mappings
is a static set of mappings which the server can immediately use. If
offset_map
is not provided, this must be non-empty, and requests that fall outside of the
mapped range will fail.
If offset_map
is provided, whenever the server receives a request with a dev_offset that
falls outside of the known range, it will consult offset_map
to attempt to resolve the
offset. Because these offset mappings must be stable for the duration of the session, the
server may cache any mappings.
This interface is intended to be used internally between nested Block implementations, in order to provide passthrough I/O. For example, a fixed partition map (e.g. GPT) will serve a Block protocol for each partition, and will respond to OpenSession requests by calling OpenSessionWithOffsetMap on the underlying block device, establishing itself as the source for translating client block offsets (relative to the partition start) to absolute offsets. The client can then communicate directly with the underlying block device, and the partition offsets can be transparently applied to requests.
GetTypeGuid
Gets the type GUID of the partition (if one exists). If the partition has no type GUID, ZX_ERR_NOT_SUPPORTED is returned.
Fields
responder: VolumeGetTypeGuidResponder
GetInstanceGuid
Gets the instance GUID of the partition (if one exists). If the partition has no instance GUID, ZX_ERR_NOT_SUPPORTED is returned.
Fields
responder: VolumeGetInstanceGuidResponder
GetName
Gets the name of the partition (if one exists). If the partition has no name, ZX_ERR_NOT_SUPPORTED is returned.
Fields
responder: VolumeGetNameResponder
GetMetadata
Gets the metadata for the partition.
Fields may be absent if the partition doesn’t have the given metadata.
Fields
responder: VolumeGetMetadataResponder
QuerySlices
Returns the number of contiguous allocated (or unallocated) vslices starting from each vslice.
GetVolumeInfo
Returns the information about this volume and the volume manager it is embedded in.
Fields
responder: VolumeGetVolumeInfoResponder
Extend
Extends the mapping of this partition.
The ability to extend the partition is dependent on having sufficient free space on the underlying device, having sufficient free slots for tracking the bytes in the volume manager header, and the partition limit (see VolumeManager.SetPartitionLimit).
Shrink
Shrinks a virtual partition. Returns ZX_OK
if ANY slices are
freed, even if part of the requested range contains unallocated slices.
Destroy
Destroys the current partition, removing it from the VolumeManager, and freeing all underlying storage. The connection to the volume is also closed.
Fields
responder: VolumeDestroyResponder
Implementations§
Source§impl VolumeRequest
impl VolumeRequest
pub fn into_get_info(self) -> Option<VolumeGetInfoResponder>
pub fn into_get_stats(self) -> Option<(bool, VolumeGetStatsResponder)>
pub fn into_open_session( self, ) -> Option<(ServerEnd<SessionMarker>, VolumeControlHandle)>
pub fn into_open_session_with_offset_map( self, ) -> Option<(ServerEnd<SessionMarker>, Option<ClientEnd<OffsetMapMarker>>, Option<Vec<BlockOffsetMapping>>, VolumeControlHandle)>
pub fn into_get_type_guid(self) -> Option<VolumeGetTypeGuidResponder>
pub fn into_get_instance_guid(self) -> Option<VolumeGetInstanceGuidResponder>
pub fn into_get_name(self) -> Option<VolumeGetNameResponder>
pub fn into_get_metadata(self) -> Option<VolumeGetMetadataResponder>
pub fn into_query_slices(self) -> Option<(Vec<u64>, VolumeQuerySlicesResponder)>
pub fn into_get_volume_info(self) -> Option<VolumeGetVolumeInfoResponder>
pub fn into_extend(self) -> Option<(u64, u64, VolumeExtendResponder)>
pub fn into_shrink(self) -> Option<(u64, u64, VolumeShrinkResponder)>
pub fn into_destroy(self) -> Option<VolumeDestroyResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL