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

Commit 784b56c4 authored by Yi-yo Chiang's avatar Yi-yo Chiang Committed by Automerger Merge Worker
Browse files

Merge "fs_mgr_overlayfs: Add scratch size override system property" am: e7f5532e

parents d972b874 e7f5532e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ using android::fiemap::IImageManager;

namespace {

constexpr char kDataScratchSizeMbProp[] = "fs_mgr.overlayfs.data_scratch_size_mb";

bool fs_mgr_access(const std::string& path) {
    return access(path.c_str(), F_OK) == 0;
}
@@ -1084,7 +1086,10 @@ static bool CreateScratchOnData(std::string* scratch_device, bool* partition_exi
        return false;
    }
    if (!images->BackingImageExists(partition_name)) {
        uint64_t size = GetIdealDataScratchSize();
        auto size = android::base::GetUintProperty<uint64_t>(kDataScratchSizeMbProp, 0) * 1_MiB;
        if (!size) {
            size = GetIdealDataScratchSize();
        }
        if (!size) {
            size = 2_GiB;
        }