zircon/system/ulib/blobfs/test/format-test.cc
// Calculates the smallest number of blobfs slices to generate a valid blobfs format.
Calculates the smallest number of blobfs slices to generate a valid blobfs format.
Calculates the smallest number of blobfs slices to generate a valid blobfs format .
uint64_t MinimumFilesystemSlices(uint64_t kSliceSize) {
  uint64_t kBlocksPerSlice = kSliceSize / kBlobfsBlockSize;
  auto BlocksToSlices = [kBlocksPerSlice](uint64_t blocks) {
    return fbl::round_up(blocks, kBlocksPerSlice) / kBlocksPerSlice;
  };
  const uint64_t kSuperBlockSlices = BlocksToSlices(1);
  const uint64_t kInodeSlices = 1;
  const uint64_t kJournalSlices = BlocksToSlices(kDefaultJournalBlocks);
  const uint64_t kDataSlices = BlocksToSlices(kMinimumDataBlocks);
  const uint64_t kBlockMapSlices = BlocksToSlices(BlocksRequiredForBits(kMinimumDataBlocks));
  return kSuperBlockSlices + kInodeSlices + kJournalSlices + kDataSlices + kBlockMapSlices;
}
uint64_t MinimumFilesystemSlices ( uint64_t kSliceSize ) { uint64_t kBlocksPerSlice = kSliceSize / kBlobfsBlockSize ; auto BlocksToSlices = [ kBlocksPerSlice ] ( uint64_t blocks ) { return fbl :: round_up ( blocks , kBlocksPerSlice ) / kBlocksPerSlice ; } ; const uint64_t kSuperBlockSlices = BlocksToSlices ( 1 ) ; const uint64_t kInodeSlices = 1 ; const uint64_t kJournalSlices = BlocksToSlices ( kDefaultJournalBlocks ) ; const uint64_t kDataSlices = BlocksToSlices ( kMinimumDataBlocks ) ; const uint64_t kBlockMapSlices = BlocksToSlices ( BlocksRequiredForBits ( kMinimumDataBlocks ) ) ; return kSuperBlockSlices + kInodeSlices + kJournalSlices + kDataSlices + kBlockMapSlices ; }
Calculates the smallest number of blobfs slices to generate a valid blobfs format.
Calculates the smallest number of blobfs slices to generate a valid blobfs format .