Merge "isBlockAligned to use uint64_t" into main
This commit is contained in:
commit
be85b80f23
2 changed files with 2 additions and 2 deletions
|
|
@ -82,7 +82,7 @@ class CowWriterV3 : public CowWriterBase {
|
|||
CowOperationType type);
|
||||
size_t GetCompressionFactor(const size_t blocks_to_compress, CowOperationType type) const;
|
||||
|
||||
constexpr bool IsBlockAligned(const size_t size) {
|
||||
constexpr bool IsBlockAligned(const uint64_t size) {
|
||||
// These are the only block size supported. Block size beyond 256k
|
||||
// may impact random read performance post OTA boot.
|
||||
const size_t values[] = {4_KiB, 8_KiB, 16_KiB, 32_KiB, 64_KiB, 128_KiB, 256_KiB};
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class ReadWorker : public Worker, public IBlockServer::Delegate {
|
|||
bool ReadFromSourceDevice(const CowOperation* cow_op, void* buffer);
|
||||
bool ReadDataFromBaseDevice(sector_t sector, void* buffer, size_t read_size);
|
||||
|
||||
constexpr bool IsBlockAligned(size_t size) { return ((size & (BLOCK_SZ - 1)) == 0); }
|
||||
constexpr bool IsBlockAligned(uint64_t size) { return ((size & (BLOCK_SZ - 1)) == 0); }
|
||||
constexpr sector_t ChunkToSector(chunk_t chunk) { return chunk << CHUNK_SHIFT; }
|
||||
constexpr chunk_t SectorToChunk(sector_t sector) { return sector >> CHUNK_SHIFT; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue