class Geometry

Defined at line 63 of file ../../src/devices/block/drivers/block-verity/geometry.h

Public Members

uint64_t total_blocks_
uint32_t hash_size_
uint32_t block_size_
uint32_t hashes_per_block_
BlockAllocation allocation_

Public Methods

void Geometry (uint32_t block_size, uint32_t hash_size, uint64_t total_blocks)

Defined at line 72 of file ../../src/devices/block/drivers/block-verity/geometry.cc

HashLocation IntegrityDataLocationForDataBlock (DataBlockIndex data_block_index)

Given a data block index, return the location in the integrity section that

contains the hash of the literal data in that block. This is used in the

verified read logic.

Defined at line 79 of file ../../src/devices/block/drivers/block-verity/geometry.cc

HashLocation NextIntegrityBlockUp (uint32_t distance_from_leaf, IntegrityBlockIndex integrity_block_index)

Given a block index into the integrity data, return the integrity data

block index and intra-block hash offset that covers that indirect block.

This is used on the verified read path -- after authenticating a data

block by checking the hash value at the location specified by

`IntegrityDataLocationForDataBlock`, we need to chain hash verification up

the merkle tree to the root. This function tells us where to find the next

block up in the merkle tree.

Defined at line 94 of file ../../src/devices/block/drivers/block-verity/geometry.cc

uint64_t AbsoluteLocationForIntegrity (IntegrityBlockIndex index)

Returns the device block offset (in virtual blocks) for the `index`th integrity block.

Defined at line 232 of file ../../src/devices/block/drivers/block-verity/geometry.cc

uint64_t AbsoluteLocationForData (DataBlockIndex index)

Returns the device block offset (in virtual blocks) for the `index`th data block.

Defined at line 236 of file ../../src/devices/block/drivers/block-verity/geometry.cc