Function gkfs::utils::arithmetic::align_left

Function Documentation

constexpr uint64_t gkfs::utils::arithmetic::align_left(const uint64_t offset, const size_t block_size)

Given a file @offset and a @block_size, align the @offset to its closest left-side block boundary.

Note

This function assumes that block_size is a power of 2.

Parameters
  • offset[in] the offset to align.

  • block_size[in] the block size used to compute boundaries.

Returns

an offset aligned to the left-side block boundary.