Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.block

PROTOCOLS

Block

Defined in fuchsia.hardware.block/block.fidl

Defines access to a device which is accessible in block-granularity chunks for reading and writing.

AttachVmo

Attaches a VMO to the currently running FIFO server.

Request

NameType
vmo handle<vmo>

Response

NameType
status zx/status
vmoid VmoId?

CloseFifo

Shuts down the fifo server, waiting for it to be ready to be started again.

When this method returns, a client may safely invoke GetFifo to acquire a new connection to the block server, without being told that a server is already serving requests on a different fifo.

If, instead of invoking "CloseFifo", a client merely closes their fifo, the server automatically cleans up all resources anyway. In this case, however, the client will have no guarantee that the next invocation of "GetFifo" will return a connection successfully.

Request

NameType

Response

NameType
status zx/status

GetFifo

Sets up a FIFO-based server on the block device; acquire the handle to it.

Request

NameType

Response

NameType
status zx/status
fifo handle<fifo>?

GetInfo

Get information about the underlying block device.

Request

NameType

Response

NameType
status zx/status
info BlockInfo?

GetStats

Returns stats about the block device on the provided buffer and optionally clears the counters.

Request

NameType
clear bool

Response

NameType
status zx/status
stats BlockStats?

RebindDevice

Rebinds the block device (if supported).

WARNING: This is only added for parity with block device ioctls; this is going to move into the device FIDL API.

Request

NameType

Response

NameType
status zx/status

Ftl

Defined in fuchsia.hardware.block/ftl.fidl

Format

Discards previous contents and reinitializes the device.

Request

NameType

Response

NameType
status zx/status

GetVmo

Requests the inspect vmo from the entity.

  • |vmo| has |ZX_RIGHTS_DUPLICATE|, |ZX_RIGHTS_TRANSFER|, |ZX_RIGHTS_READ|

Request

NameType

Response

NameType
result InspectVmoProvider_GetVmo_Result

InspectVmoProvider

Defined in fuchsia.hardware.block/ftl.fidl

It is treated as a separate protocol for extension if necessary.

GetVmo

Requests the inspect vmo from the entity.

  • |vmo| has |ZX_RIGHTS_DUPLICATE|, |ZX_RIGHTS_TRANSFER|, |ZX_RIGHTS_READ|

Request

NameType

Response

NameType
result InspectVmoProvider_GetVmo_Result

STRUCTS

BlockInfo

Defined in fuchsia.hardware.block/block.fidl

Describes metatadata about a block device.

NameTypeDescriptionDefault
block_count uint64

The number of blocks in this block device.

No default
block_size uint32

The size of a single block.

No default
max_transfer_size uint32

The maximum size, in bytes, of a transfer. Set to MAX_TRANSFER_UNBOUNDED if no such maximum exists.

No default
flags uint32

Identifiers about the device; refer to the "FLAG_*" documentation above.

No default
reserved uint32 No default

BlockStats

Defined in fuchsia.hardware.block/block.fidl

Describes statistics about the operations on the block device since boot. storage_metrics.CallStat.bytes_transferred is number of bytes requested to be transferred.

NameTypeDescriptionDefault
read fuchsia.storage.metrics/CallStat

The stats about read from the device.

No default
write fuchsia.storage.metrics/CallStat

The stats about write to the device.

No default
trim fuchsia.storage.metrics/CallStat

The stats about trim commands.

No default
flush fuchsia.storage.metrics/CallStat

The stats about flush commands.

No default
barrier_before fuchsia.storage.metrics/CallStat

The stats about barrier before commands.

No default
barrier_after fuchsia.storage.metrics/CallStat

The stats about barrier after commands.

No default

InspectVmoProvider_GetVmo_Response

Defined in fuchsia.hardware.block/ftl.fidl

NameTypeDescriptionDefault
vmo handle<vmo> No default

VmoId

Defined in fuchsia.hardware.block/block.fidl

A client-identifier to a VMO. This value may be utilized by clients to refer to a VMO which is being held by a block device server.

NameTypeDescriptionDefault
id uint16 No default

UNIONS

InspectVmoProvider_GetVmo_Result

Defined in fuchsia.hardware.block/ftl.fidl

NameTypeDescription
response InspectVmoProvider_GetVmo_Response
err zx/status

CONSTANTS

NameValueTypeDescription
FLAG_BOOTPART 4 uint32

The device has a bootdata partition map.

FLAG_READONLY 1 uint32

All writes to the block device will fail.

FLAG_REMOVABLE 2 uint32

The block device may be removed from the device during operation.

FLAG_TRIM_SUPPORT 8 uint32

The device provides trim support.

MAX_TRANSFER_UNBOUNDED 4294967295 uint32

The maximum value for a transfer size, identifying that there effectively exists no maximum for a single operation.

VMOID_INVALID 0 uint16

Dummy value reserved for "invalid" VmoId. Will never be allocated by the server, and may be utilized as a local value for an unallocated ID.