class Sealer

Defined at line 24 of file ../../src/devices/block/drivers/block-verity/sealer.h

Protected Members

Geometry geometry_
State state_
IntegrityBlockIndex integrity_block_index_
DataBlockIndex data_block_index_
vector hash_block_accumulators_
uint8_t[32] root_hash_
uint8_t[32] final_seal_
sealer_callback callback_

Public Methods

void ~Sealer ()

Defined at line 27 of file ../../src/devices/block/drivers/block-verity/sealer.h

void Sealer (const Sealer & )

Disallow copy

&

assign. Allow move.

Defined at line 30 of file ../../src/devices/block/drivers/block-verity/sealer.h

Sealer & operator= (const Sealer & )

Defined at line 31 of file ../../src/devices/block/drivers/block-verity/sealer.h

void Sealer (Geometry geometry)

Defined at line 42 of file ../../src/devices/block/drivers/block-verity/sealer.cc

zx_status_t StartSealing (void * cookie, sealer_callback callback)

Defined at line 49 of file ../../src/devices/block/drivers/block-verity/sealer.cc

Protected Methods

void ScheduleNextWorkUnit ()

Based on current state: either take an action (request an I/O) or advance

the state machine.

Defined at line 82 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void RequestNextRead ()

Request the next data block(s) from disk so we can hash them.

Defined at line 129 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void WriteIntegrityIfReady ()

Check if any integrity accumulators are full. If so, write them out and

prepare new empty ones.

Defined at line 138 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void PrepareSuperblock (uint8_t * block_buf)

Prepares the superblock into block_buf based on the geometry information

and root hash given.

Defined at line 193 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void Fail (zx_status_t error)

Mark the computation as failed and trigger the sealer's callback.

Defined at line 202 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void RequestRead (uint64_t block)

Requests to read the block at the absolute block position `block`. Expects

`CompleteRead` to be called with the I/O's status and (if successful) the

contents of the block read.

void CompleteRead (zx_status_t status, uint8_t * block_data)

The function that should be called back when the read request completes.

Defined at line 215 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void WriteIntegrityBlock (HashBlockAccumulator & hba, uint64_t block)

Requests to write the contents of the (full) HashBlockAccumulator to the

integrity block at `integrity_block`. Expects CompleteIntegrityWrite to be

called with the I/O's status upon completion.

void CompleteIntegrityWrite (zx_status_t status)

The function that should be called back when the write request completes.

Defined at line 234 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void WriteSuperblock ()

Requests that the I/O implementation call `PrepareSuperblock` with a

suitable buffer, then write the contents of the buffer perpared to the

zeroth block of the device.

void CompleteSuperblockWrite (zx_status_t status)

The function that should be called back when the write request completes.

Defined at line 245 of file ../../src/devices/block/drivers/block-verity/sealer.cc

void RequestFlush ()

Requests that the I/O implementation flush all pending writes, then call

`CompleteFlush`.

void CompleteFlush (zx_status_t status)

The function that should be called back when the flush request completes.

Defined at line 256 of file ../../src/devices/block/drivers/block-verity/sealer.cc

Enumerations

enum State
Name Value
Initial 0
ReadLoop 1
PadHashBlocks 2
CommitSuperblock 3
FinalFlush 4
Done 5
Failed 6

Defined at line 35 of file ../../src/devices/block/drivers/block-verity/sealer.h