class BlockDevice
Defined at line 25 of file ../../src/storage/lib/block_client/cpp/block_device.h
A high-level interface to a block device. This class also inherits from VmoidRegistry for
managing the VMOs associated with block requests.
The normal implementation would be a RemoteBlockDevice which speaks the FIDL/FIFO protocols
Public Methods
zx_status_t FifoTransaction (BlockFifoRequest * requests, size_t count)
FIFO protocol. This is the normal way to read from and write to the block device.
zx::result<std::string> GetTopologicalPath ()
Returns the full topological path of the device.
zx::result<> Rebind (std::string_view url_suffix)
Attempts to rebind a given driver to the device. If `url_suffix` is empty, then the device
will be bound based on its bind rules.
zx_status_t BlockGetInfo (fuchsia_storage_block::wire::BlockInfo * out_info)
fuchsia.storage.block interface:
zx_status_t BlockDetachVmo (storage::Vmoid vmoid)
storage::VmoidRegistry implementation:
Derived classes will need to implement BlockAttachVmo() according to their requirements. This
implementation implements detach by sending a FIFO transaction which should work for most
cases.
Defined at line 9 of file ../../src/storage/lib/block_client/cpp/block_device.cc
zx_status_t VolumeGetInfo (fuchsia_storage_block::wire::VolumeManagerInfo * out_manager_info, fuchsia_storage_block::wire::VolumeInfo * out_volume_info)
fuchsia.storage.block.Block volume interface:
Some block devices (like FVM partitions) are also volumes. This provides a convenience wrapper
for speaking the volume-specific methods.
If the underlying device does not speak the Volume API, these calls will fail with
ZX_ERR_NOT_SUPPORTED. Clients should call VolumeGetInfo() and check for ZX_OK to confirm that
the device supports the Volume API before using any other Volume methods.
zx_status_t VolumeQuerySlices (const uint64_t * slices, size_t slices_count, fuchsia_storage_block::wire::VsliceRange * out_ranges, size_t * out_ranges_count)
zx_status_t VolumeExtend (uint64_t offset, uint64_t length)
zx_status_t VolumeShrink (uint64_t offset, uint64_t length)