pub enum VolumeAndNodeRequest {
Show 37 variants
GetInfo {
responder: VolumeAndNodeGetInfoResponder,
},
GetStats {
clear: bool,
responder: VolumeAndNodeGetStatsResponder,
},
OpenSession {
session: ServerEnd<SessionMarker>,
control_handle: VolumeAndNodeControlHandle,
},
ReadBlocks {
vmo: Vmo,
length: u64,
dev_offset: u64,
vmo_offset: u64,
responder: VolumeAndNodeReadBlocksResponder,
},
WriteBlocks {
vmo: Vmo,
length: u64,
dev_offset: u64,
vmo_offset: u64,
responder: VolumeAndNodeWriteBlocksResponder,
},
GetTypeGuid {
responder: VolumeAndNodeGetTypeGuidResponder,
},
GetInstanceGuid {
responder: VolumeAndNodeGetInstanceGuidResponder,
},
GetName {
responder: VolumeAndNodeGetNameResponder,
},
QuerySlices {
start_slices: Vec<u64>,
responder: VolumeAndNodeQuerySlicesResponder,
},
GetVolumeInfo {
responder: VolumeAndNodeGetVolumeInfoResponder,
},
Extend {
start_slice: u64,
slice_count: u64,
responder: VolumeAndNodeExtendResponder,
},
Shrink {
start_slice: u64,
slice_count: u64,
responder: VolumeAndNodeShrinkResponder,
},
Destroy {
responder: VolumeAndNodeDestroyResponder,
},
Clone {
flags: OpenFlags,
object: ServerEnd<NodeMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetAttr {
responder: VolumeAndNodeGetAttrResponder,
},
SetAttr {
flags: NodeAttributeFlags,
attributes: NodeAttributes,
responder: VolumeAndNodeSetAttrResponder,
},
GetFlags {
responder: VolumeAndNodeGetFlagsResponder,
},
SetFlags {
flags: OpenFlags,
responder: VolumeAndNodeSetFlagsResponder,
},
QueryFilesystem {
responder: VolumeAndNodeQueryFilesystemResponder,
},
Close {
responder: VolumeAndNodeCloseResponder,
},
Query {
responder: VolumeAndNodeQueryResponder,
},
Reopen {
rights_request: RightsRequest,
object_request: ServerEnd<NodeMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetConnectionInfo {
responder: VolumeAndNodeGetConnectionInfoResponder,
},
GetAttributes {
query: NodeAttributesQuery,
responder: VolumeAndNodeGetAttributesResponder,
},
UpdateAttributes {
payload: MutableNodeAttributes,
responder: VolumeAndNodeUpdateAttributesResponder,
},
Sync {
responder: VolumeAndNodeSyncResponder,
},
ListExtendedAttributes {
iterator: ServerEnd<ExtendedAttributeIteratorMarker>,
control_handle: VolumeAndNodeControlHandle,
},
GetExtendedAttribute {
name: Vec<u8>,
responder: VolumeAndNodeGetExtendedAttributeResponder,
},
SetExtendedAttribute {
name: Vec<u8>,
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
responder: VolumeAndNodeSetExtendedAttributeResponder,
},
RemoveExtendedAttribute {
name: Vec<u8>,
responder: VolumeAndNodeRemoveExtendedAttributeResponder,
},
ConnectToDeviceFidl {
server: Channel,
control_handle: VolumeAndNodeControlHandle,
},
ConnectToController {
server: ServerEnd<ControllerMarker>,
control_handle: VolumeAndNodeControlHandle,
},
Bind {
driver: String,
responder: VolumeAndNodeBindResponder,
},
Rebind {
driver: String,
responder: VolumeAndNodeRebindResponder,
},
UnbindChildren {
responder: VolumeAndNodeUnbindChildrenResponder,
},
ScheduleUnbind {
responder: VolumeAndNodeScheduleUnbindResponder,
},
GetTopologicalPath {
responder: VolumeAndNodeGetTopologicalPathResponder,
},
}
Expand description
This protocol is intended to emulate a block device.
Variants§
GetInfo
Get information about the underlying block device.
Fields
responder: VolumeAndNodeGetInfoResponder
GetStats
Returns stats about block device operations. Setting clear
will reset stats counters.
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
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: VolumeAndNodeGetTypeGuidResponder
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: VolumeAndNodeGetInstanceGuidResponder
GetName
Gets the name of the partition (if one exists). If the partition has no name, ZX_ERR_NOT_SUPPORTED is returned.
Fields
responder: VolumeAndNodeGetNameResponder
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: VolumeAndNodeGetVolumeInfoResponder
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: VolumeAndNodeDestroyResponder
Clone
Create another connection to the same remote object.
flags
may be any of:
OpenFlags.RIGHT_*
OpenFlags.APPEND
OpenFlags.DESCRIBE
OpenFlags.CLONE_SAME_RIGHTS
All other flags are ignored.
The OpenFlags.RIGHT_*
bits in flags
request corresponding rights over the resulting
cloned object.
The cloned object must have rights less than or equal to the original object, otherwise
returns ZX_ERR_ACCESS_DENIED
.
Alternatively, pass OpenFlags.CLONE_SAME_RIGHTS
to inherit the rights on the source connection.
It is invalid to pass any of the OpenFlags.RIGHT_*
flags together with
OpenFlags.CLONE_SAME_RIGHTS
.
GetAttr
Acquires information about the node.
This method does not require any rights.
Fields
responder: VolumeAndNodeGetAttrResponder
SetAttr
Updates information about the node.
This method requires following rights: OpenFlags.RIGHT_WRITABLE
, otherwise returns
ZX_ERR_BAD_HANDLE
.
Fields
flags: NodeAttributeFlags
attributes: NodeAttributes
responder: VolumeAndNodeSetAttrResponder
GetFlags
Acquires the Directory.Open
rights and flags used to access this file.
This method does not require any rights.
Fields
responder: VolumeAndNodeGetFlagsResponder
SetFlags
Changes the Directory.Open
flags used to access the file.
Supported flags which can be turned on / off:
OpenFlags.APPEND
This method does not require any rights.
QueryFilesystem
Query the filesystem for filesystem-specific information.
Fields
responder: VolumeAndNodeQueryFilesystemResponder
Close
Terminates the connection.
After calling Close
, the client must not send any other requests.
Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.
Closing the client end of the channel should be semantically equivalent
to calling Close
without knowing when the close has completed or its
status.
Fields
responder: VolumeAndNodeCloseResponder
Query
Fields
responder: VolumeAndNodeQueryResponder
Reopen
Creates another connection to the same node.
Fields
rights_request: RightsRequest
object_request: ServerEnd<NodeMarker>
control_handle: VolumeAndNodeControlHandle
GetConnectionInfo
Acquires information about the connection.
This method does not require any rights.
Fields
responder: VolumeAndNodeGetConnectionInfoResponder
GetAttributes
Acquires information about the node.
The attributes of a node should be stable, independent of the specific protocol used to access it.
If a particular attribute is not applicable or not supported, filesystems should leave the corresponding field absent.
query
a bit-mask specifying which attributes to fetch. The server should not return more than necessary.
attributes
the returned attributes.
This method requires the [Rights.GET_ATTRIBUTES
] right.
UpdateAttributes
Updates information about the node.
attributes
the presence of a table field inattributes
indicates the intent to update the corresponding attribute.
This method requires the [Rights.UPDATE_ATTRIBUTES
] right.
Sync
Synchronizes updates to the node to the underlying media, if it exists.
This method will return when the filesystem server has flushed the
relevant updates to the underlying media, but does not guarantee the
underlying media has persisted the information, nor that any information
is committed to hardware. Clients may use Sync
to ensure ordering
between operations.
This method does not require any rights.
Fields
responder: VolumeAndNodeSyncResponder
ListExtendedAttributes
Creates an iterator over all the extended attribute names associated with this node. If an error occurs it is returned as an epitaph on the iterator request channel, and then the channel is closed.
GetExtendedAttributes can be used with any of these names to retrieve the associated value.
This method requires the [Rights.GET_ATTRIBUTES
] right.
Fields
iterator: ServerEnd<ExtendedAttributeIteratorMarker>
control_handle: VolumeAndNodeControlHandle
GetExtendedAttribute
Get the value associated with the given attribute name
for this node.
Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No particular structure is imposed on them.
This method requires the [Rights.GET_ATTRIBUTES
] right.
SetExtendedAttribute
Set the value for the given attribute name
to value
for this node.
The attribute name may exist, in which case the attribute is updated. If the attribute doesn’t exist, it is created. The name should have no null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
This method requires the [Rights.UPDATE_ATTRIBUTES
] right.
Fields
value: ExtendedAttributeValue
mode: SetExtendedAttributeMode
responder: VolumeAndNodeSetExtendedAttributeResponder
RemoveExtendedAttribute
Remove the specified extended attribute.
If the attribute doesn’t exist, ZX_ERR_NOT_FOUND is returned.
This method requires the [Rights.UPDATE_ATTRIBUTES
] right.
ConnectToDeviceFidl
Connect to the underlying device’s FIDL protocol. This connection will not be multiplexed with fuchsia.device.Controller or fuchsia.io.Node.
ConnectToController
Connect to the same Controller FIDL protocol.
Bind
Attempt to bind a driver to this device.
- request
driver
This represents the suffix of a driver URL (e.g: “fvm.cm”). If this is non-empty, then the only drivers that will try to bind are ones that match this url suffix.
Rebind
Unbind all the children of this device, and then attempt to bind a driver to the device. This will not return until the bind completes.
- request
driver
This represents the suffix of a driver URL (e.g: “fvm.cm”). If this is non-empty, then the only drivers that will try to bind are ones that match this url suffix.
UnbindChildren
This api will unbind all the children of this device synchronously. This will avoid watching for device removal by the clients.
Fields
responder: VolumeAndNodeUnbindChildrenResponder
ScheduleUnbind
Disconnect this device and allow its parent to be bound again. This may not complete before it returns.
Fields
responder: VolumeAndNodeScheduleUnbindResponder
GetTopologicalPath
Return the topological path for this device
Fields
responder: VolumeAndNodeGetTopologicalPathResponder
Implementations§
source§impl VolumeAndNodeRequest
impl VolumeAndNodeRequest
pub fn into_get_info(self) -> Option<VolumeAndNodeGetInfoResponder>
pub fn into_get_stats(self) -> Option<(bool, VolumeAndNodeGetStatsResponder)>
pub fn into_open_session( self ) -> Option<(ServerEnd<SessionMarker>, VolumeAndNodeControlHandle)>
pub fn into_read_blocks( self ) -> Option<(Vmo, u64, u64, u64, VolumeAndNodeReadBlocksResponder)>
pub fn into_write_blocks( self ) -> Option<(Vmo, u64, u64, u64, VolumeAndNodeWriteBlocksResponder)>
pub fn into_get_type_guid(self) -> Option<VolumeAndNodeGetTypeGuidResponder>
pub fn into_get_instance_guid( self ) -> Option<VolumeAndNodeGetInstanceGuidResponder>
pub fn into_get_name(self) -> Option<VolumeAndNodeGetNameResponder>
pub fn into_query_slices( self ) -> Option<(Vec<u64>, VolumeAndNodeQuerySlicesResponder)>
pub fn into_get_volume_info(self) -> Option<VolumeAndNodeGetVolumeInfoResponder>
pub fn into_extend(self) -> Option<(u64, u64, VolumeAndNodeExtendResponder)>
pub fn into_shrink(self) -> Option<(u64, u64, VolumeAndNodeShrinkResponder)>
pub fn into_destroy(self) -> Option<VolumeAndNodeDestroyResponder>
pub fn into_clone( self ) -> Option<(OpenFlags, ServerEnd<NodeMarker>, VolumeAndNodeControlHandle)>
pub fn into_get_attr(self) -> Option<VolumeAndNodeGetAttrResponder>
pub fn into_set_attr( self ) -> Option<(NodeAttributeFlags, NodeAttributes, VolumeAndNodeSetAttrResponder)>
pub fn into_get_flags(self) -> Option<VolumeAndNodeGetFlagsResponder>
pub fn into_set_flags( self ) -> Option<(OpenFlags, VolumeAndNodeSetFlagsResponder)>
pub fn into_query_filesystem( self ) -> Option<VolumeAndNodeQueryFilesystemResponder>
pub fn into_close(self) -> Option<VolumeAndNodeCloseResponder>
pub fn into_query(self) -> Option<VolumeAndNodeQueryResponder>
pub fn into_reopen( self ) -> Option<(RightsRequest, ServerEnd<NodeMarker>, VolumeAndNodeControlHandle)>
pub fn into_get_connection_info( self ) -> Option<VolumeAndNodeGetConnectionInfoResponder>
pub fn into_get_attributes( self ) -> Option<(NodeAttributesQuery, VolumeAndNodeGetAttributesResponder)>
pub fn into_update_attributes( self ) -> Option<(MutableNodeAttributes, VolumeAndNodeUpdateAttributesResponder)>
pub fn into_sync(self) -> Option<VolumeAndNodeSyncResponder>
pub fn into_list_extended_attributes( self ) -> Option<(ServerEnd<ExtendedAttributeIteratorMarker>, VolumeAndNodeControlHandle)>
pub fn into_get_extended_attribute( self ) -> Option<(Vec<u8>, VolumeAndNodeGetExtendedAttributeResponder)>
pub fn into_set_extended_attribute( self ) -> Option<(Vec<u8>, ExtendedAttributeValue, SetExtendedAttributeMode, VolumeAndNodeSetExtendedAttributeResponder)>
pub fn into_remove_extended_attribute( self ) -> Option<(Vec<u8>, VolumeAndNodeRemoveExtendedAttributeResponder)>
pub fn into_connect_to_device_fidl( self ) -> Option<(Channel, VolumeAndNodeControlHandle)>
pub fn into_connect_to_controller( self ) -> Option<(ServerEnd<ControllerMarker>, VolumeAndNodeControlHandle)>
pub fn into_bind(self) -> Option<(String, VolumeAndNodeBindResponder)>
pub fn into_rebind(self) -> Option<(String, VolumeAndNodeRebindResponder)>
pub fn into_unbind_children( self ) -> Option<VolumeAndNodeUnbindChildrenResponder>
pub fn into_schedule_unbind( self ) -> Option<VolumeAndNodeScheduleUnbindResponder>
pub fn into_get_topological_path( self ) -> Option<VolumeAndNodeGetTopologicalPathResponder>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL