Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b86b339c authored by Kelvin Zhang's avatar Kelvin Zhang Committed by Gerrit Code Review
Browse files

Merge "Add a function to determine cow op size" into main

parents 3250a0a2 a33cdc99
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -329,6 +329,16 @@ struct BufferState {
    uint8_t read_ahead_state;
} __attribute__((packed));

constexpr size_t GetCowOpSize(size_t version) {
    if (version == 3) {
        return sizeof(CowOperationV3);
    } else if (version == 2 || version == 1) {
        return sizeof(CowOperationV2);
    } else {
        return 0;
    }
}

// 2MB Scratch space used for read-ahead
static constexpr uint64_t BUFFER_REGION_DEFAULT_SIZE = (1ULL << 21);