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

Commit 3c0d2661 authored by David Anderson's avatar David Anderson Committed by Automerger Merge Worker
Browse files

Merge "remount: Ensure that scratch images are block-size aligned." am:...

Merge "remount: Ensure that scratch images are block-size aligned." am: c20b6b58 am: bc11b2b3 am: 9dc7fc6d am: 79fd8676 am: a72f63e4

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2159540



Change-Id: Id223cfbab532ed0a89a9d45c6932421e10b23556
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cdf6c7da a72f63e4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1140,7 +1140,13 @@ static inline uint64_t GetIdealDataScratchSize() {
        return 0;
    }

    return std::min(super_info.size, (uint64_t(s.f_frsize) * s.f_bfree) / 2);
    auto ideal_size = std::min(super_info.size, (uint64_t(s.f_frsize) * s.f_bfree) / 2);

    // Align up to the filesystem block size.
    if (auto remainder = ideal_size % s.f_bsize; remainder > 0) {
        ideal_size += s.f_bsize - remainder;
    }
    return ideal_size;
}

static bool CreateScratchOnData(std::string* scratch_device, bool* partition_exists, bool* change) {