24 "MSF magic header doesn't match");
27 return make_error<MSFError>(msf_error_code::invalid_format,
28 "Unsupported block size.");
32 return make_error<MSFError>(msf_error_code::invalid_format,
33 "Directory size is not multiple of 4.");
37 uint64_t NumDirectoryBlocks =
45 "Too many directory blocks.");
49 "Block 0 is reserved");
53 "Block map address is invalid.");
56 return make_error<MSFError>(
58 "The free block map isn't at block 1 or block 2.");
64 bool IncludeUnusedFpmData,
77 if (IncludeUnusedFpmData)
char MagicBytes[sizeof(Magic)]
This class represents lattice values for constants.
Error validateSuperBlock(const SuperBlock &SB)
Describes the layout of a stream in an MSF layout.
MSFStreamLayout getFpmStreamLayout(const MSFLayout &Msf, bool IncludeUnusedFpmData=false, bool AltFpm=false)
Determine the layout of the FPM stream, given the MSF layout.
uint32_t getFpmIntervalLength(const MSFLayout &L)
std::vector< support::ulittle32_t > Blocks
uint32_t getNumFpmIntervals(uint32_t BlockSize, uint32_t NumBlocks, bool IncludeUnusedFpmData, int FpmNumber)
Given an MSF with the specified block size and number of blocks, determine how many pieces the specif...
support::ulittle32_t BlockSize
support::ulittle32_t BlockMapAddr
static const char Magic[]
uint32_t alternateFpmBlock() const
static ErrorSuccess success()
Create a success value.
uint64_t bytesToBlocks(uint64_t NumBytes, uint64_t BlockSize)
Merge contiguous icmps into a memcmp
uint32_t mainFpmBlock() const
uint64_t divideCeil(uint64_t Numerator, uint64_t Denominator)
Returns the integer ceil(Numerator / Denominator).
support::ulittle32_t FreeBlockMapBlock
Lightweight error class with error context and mandatory checking.
bool isValidBlockSize(uint32_t Size)
support::ulittle32_t NumDirectoryBytes
support::ulittle32_t NumBlocks