pub enum VolumeRequest {
Show 13 variants
GetInfo {
responder: VolumeGetInfoResponder,
},
GetStats {
clear: bool,
responder: VolumeGetStatsResponder,
},
OpenSession {
session: ServerEnd<SessionMarker>,
control_handle: VolumeControlHandle,
},
ReadBlocks {
vmo: Vmo,
length: u64,
dev_offset: u64,
vmo_offset: u64,
responder: VolumeReadBlocksResponder,
},
WriteBlocks {
vmo: Vmo,
length: u64,
dev_offset: u64,
vmo_offset: u64,
responder: VolumeWriteBlocksResponder,
},
GetTypeGuid {
responder: VolumeGetTypeGuidResponder,
},
GetInstanceGuid {
responder: VolumeGetInstanceGuidResponder,
},
GetName {
responder: VolumeGetNameResponder,
},
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
Fields
responder: VolumeGetInfoResponder
Get information about the underlying block device.
GetStats
Returns stats about the block device on the provided buffer and optionally clears the counters.
storage_metrics.CallStat.bytes_transferred is number of bytes requested to be transferred.
OpenSession
Opens a new FIFO-based session on the block device.
ReadBlocks
Reads from a block device.
This read does not require exclusive access. length, dev_offset and vmo_offset are specified in bytes, but they must be block-aligned. This method is provided for backward compatibility, and is not intended for new code. New code should use the FIFO interface along with the client libraries to read and write from block devices.
WriteBlocks
Writes to a block device.
This write does not require exclusive access. length, dev_offset and vmo_offset are specified in bytes, but they must be block-aligned. This method is provided for backward compatibility, and is not intended for new code. New code should use the FIFO interface along with the client libraries to read and write from block devices.
GetTypeGuid
Fields
responder: VolumeGetTypeGuidResponder
Gets the type GUID of the partition (if one exists). If the partition has no type GUID, ZX_ERR_NOT_SUPPORTED is returned.
GetInstanceGuid
Fields
responder: VolumeGetInstanceGuidResponder
Gets the instance GUID of the partition (if one exists). If the partition has no instance GUID, ZX_ERR_NOT_SUPPORTED is returned.
GetName
Fields
responder: VolumeGetNameResponder
Gets the name of the partition (if one exists). If the partition has no name, ZX_ERR_NOT_SUPPORTED is returned.
QuerySlices
Returns the number of contiguous allocated (or unallocated) vslices starting from each vslice.
GetVolumeInfo
Fields
responder: VolumeGetVolumeInfoResponder
Returns the information about this volume and the volume manager it is embedded in.
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
Fields
responder: VolumeDestroyResponder
Destroys the current partition, removing it from the VolumeManager, and freeing all underlying storage. The connection to the volume is also closed.
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_read_blocks( self ) -> Option<(Vmo, u64, u64, u64, VolumeReadBlocksResponder)>
pub fn into_write_blocks( self ) -> Option<(Vmo, u64, u64, u64, VolumeWriteBlocksResponder)>
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_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