Namespaces

Enumerations

enum FvmImplementation
Name Value
kDriver 0
kComponent 1

Defined at line 23 of file ../../src/storage/fvm/fvm_test_instance.h

enum SparseFlags
Name Value
kSparseFlagLz4 0x1
kSparseFlagZxcrypt 0x2
kSparseFlagCorrupted 0x4
kSparseFlagZeroFillNotRequired 0x8
kDeprecated0 0x10
kSparseFlagAllValid kSparseFlagLz4 | kSparseFlagZxcrypt | kSparseFlagCorrupted | kSparseFlagZeroFillNotRequired | kDeprecated0

Defined at line 49 of file ../../src/storage/fvm/fvm_sparse.h

enum SuperblockType
Name Value
kPrimary 0
kSecondary 1

Defines the type of superblocks of an FVM. The key difference is how the offset from the

beginning is calculated. They both share the same format.

Defined at line 151 of file ../../src/storage/fvm/format.h

Records

Functions

  • void UpdateHash (void * metadata, size_t metadata_size)

    Update's the metadata's hash field to accurately reflect the contents of metadata.

    Defined at line 67 of file ../../src/storage/fvm/fvm.cc

  • zx_status_t ResetAllSlices (block_client::BlockDevice * device)

    Walks through all slices on the partition backed by |device|, attempting to

    free everything except for the first slice.

    Defined at line 19 of file ../../src/storage/fvm/client.cc

  • SliceEntry CreateSliceEntry (uint16_t vpart)

    Defined at line 21 of file ../../src/storage/fvm/metadata_test.cc

  • VPartitionEntry CreatePartitionEntry (size_t slices)

    Defined at line 28 of file ../../src/storage/fvm/metadata_test.cc

  • std::unique_ptr<FvmInstance> CreateFvmInstance (FvmImplementation impl)

    Defined at line 397 of file ../../src/storage/fvm/fvm_test_instance.cc

  • std::ostream & operator<< (std::ostream & out, const Header & header)

    Outputs a compact, single-line description of the header (useful for syslog). See

    Header.ToString() for a more verbose multiline version.

    Defined at line 247 of file ../../src/storage/fvm/format.cc

  • std::ostream & operator<< (std::ostream & out, const VPartitionEntry & entry)

    Outputs a single-line description of the partition entry.

    Defined at line 302 of file ../../src/storage/fvm/format.cc

  • std::ostream & operator<< (std::ostream & out, const SliceEntry & entry)

    Outputs a single-line description of the partition entry.

    Defined at line 339 of file ../../src/storage/fvm/format.cc

  • size_t PartitionTableByteSizeForUsablePartitionCount (size_t usable_partitions)

    Due to the way partitions are counted, the usable partitions (the input to this function) is one

    smaller than the number table entries because the 0th entry is not used. This function may

    generate a larger-than-needed partition table to ensure it's block-aligned.

    TODO(https://fxbug.dev/42138108) Remove the unused 0th entry so we can actually use the full

    number passed in.

    Defined at line 477 of file ../../src/storage/fvm/format.h

  • size_t AllocTableByteSizeForUsableSliceCount (size_t slice_count)

    Defined at line 483 of file ../../src/storage/fvm/format.h

  • size_t BlocksToSlices (size_t slice_size, size_t block_size, size_t block_count)

    Defined at line 491 of file ../../src/storage/fvm/format.h

  • size_t SlicesToBlocks (size_t slice_size, size_t block_size, size_t slice_count)

    Defined at line 500 of file ../../src/storage/fvm/format.h

  • bool ValidateHeader (const void * metadata, size_t metadata_size)

    Validate the FVM header.

    TODO(jfsulliv): Remove this once all uses are ported to Metadata.

  • void ValidateMetadata (Metadata & metadata, const std::vector<VPartitionEntry> & expected_partitions, const std::vector<SliceEntry> & expected_slices)

    Defined at line 47 of file ../../src/storage/fvm/metadata_test.cc

  • std::optional<SuperblockType> PickValidHeader (const void * primary_metadata, const void * secondary_metadata, size_t metadata_size)

    Validate the FVM header information, and identify which copy of metadata (primary or backup)

    should be used for initial reading, if either.

    The two copies of the metadata block from the beginning of the device is passed in, along with

    their length (they should be the same size). These blocks should include both primary and

    secondary copies of the metadata.

    The disk_size and disk_block_size are passed in to sanity check that the header values are

    compatible with the current underlying device. See fvm::Header::IsValid() for more. The variant

    that omits these does not validate the header matches these values.

    On success, the superblock type which is valid is returned. If both copies are invalid, a null

    optional is returned.

    TODO(jfsulliv): Stop exposing this as a separate function once all code uses the Metadata class.

    Defined at line 75 of file ../../src/storage/fvm/fvm.cc

  • void CheckMetadataContainSameEntries (const Metadata & a, const Metadata & b)

    Defined at line 76 of file ../../src/storage/fvm/metadata_test.cc

  • std::optional<SuperblockType> PickValidHeader (uint64_t disk_size, uint64_t disk_block_size, const void * primary_metadata, const void * secondary_metadata, size_t metadata_size)

    Defined at line 82 of file ../../src/storage/fvm/fvm.cc

  • fbl::Array<uint8_t> MakeRandomBuffer (size_t size, unsigned int * seed)

    Returns an array with random contents.

    Defined at line 425 of file ../../src/storage/fvm/test_support.cc

  • bool IsConsistentAfterGrowth (const VolumeManagerInfo & beforeconst VolumeManagerInfo & after)

    Returns true if the invariants of the fvm volumes are the same (same slize_size, same allocated

    count).

    Defined at line 435 of file ../../src/storage/fvm/test_support.cc

Variables

zx_driver_ops_t driver_ops

Defined at line 948 of file ../../src/storage/fvm/driver/vpartition_manager.cc