Loading adb/client/incremental_utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <stdint.h> #include <android-base/off64_t.h> namespace incremental { using Size = int64_t; Loading fs_mgr/fs_mgr.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, const struct ext4_super_block* sb, int* fs_stat) { bool has_quota = (sb->s_feature_ro_compat & cpu_to_le32(EXT4_FEATURE_RO_COMPAT_QUOTA)) != 0; bool want_quota = entry.fs_mgr_flags.quota; bool want_projid = android::base::GetBoolProperty("ro.emulated_storage.projid", false); bool want_projid = android::base::GetBoolProperty("external_storage.projid.enabled", false); if (has_quota == want_quota) { return; Loading Loading @@ -521,7 +521,8 @@ static void tune_verity(const std::string& blk_device, const FstabEntry& entry, static void tune_casefold(const std::string& blk_device, const struct ext4_super_block* sb, int* fs_stat) { bool has_casefold = (sb->s_feature_incompat & cpu_to_le32(EXT4_FEATURE_INCOMPAT_CASEFOLD)) != 0; bool wants_casefold = android::base::GetBoolProperty("ro.emulated_storage.casefold", false); bool wants_casefold = android::base::GetBoolProperty("external_storage.casefold.enabled", false); if (!wants_casefold || has_casefold) return; Loading fs_mgr/fs_mgr_format.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -160,8 +160,8 @@ int fs_mgr_do_format(const FstabEntry& entry, bool crypt_footer) { bool needs_projid = false; if (entry.mount_point == "/data") { needs_casefold = android::base::GetBoolProperty("ro.emulated_storage.casefold", false); needs_projid = android::base::GetBoolProperty("ro.emulated_storage.projid", false); needs_casefold = android::base::GetBoolProperty("external_storage.casefold.enabled", false); needs_projid = android::base::GetBoolProperty("external_storage.projid.enabled", false); } if (entry.fs_type == "f2fs") { Loading init/reboot.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -203,6 +203,7 @@ static void TurnOffBacklight() { } static Result<void> CallVdc(const std::string& system, const std::string& cmd) { LOG(INFO) << "Calling /system/bin/vdc " << system << " " << cmd; const char* vdc_argv[] = {"/system/bin/vdc", system.c_str(), cmd.c_str()}; int status; if (logwrap_fork_execvp(arraysize(vdc_argv), vdc_argv, &status, false, LOG_KLOG, true, Loading Loading @@ -456,10 +457,14 @@ static UmountStat TryUmountAndFsck(unsigned int cmd, bool run_fsck, #define ZRAM_RESET "/sys/block/zram0/reset" #define ZRAM_BACK_DEV "/sys/block/zram0/backing_dev" static Result<void> KillZramBackingDevice() { if (access(ZRAM_BACK_DEV, F_OK) != 0 && errno == ENOENT) { LOG(INFO) << "No zram backing device configured"; return {}; } std::string backing_dev; if (!android::base::ReadFileToString(ZRAM_BACK_DEV, &backing_dev)) return {}; if (!android::base::StartsWith(backing_dev, "/dev/block/loop")) return {}; if (!android::base::ReadFileToString(ZRAM_BACK_DEV, &backing_dev)) { return ErrnoError() << "Failed to read " << ZRAM_BACK_DEV; } // cut the last "\n" backing_dev.erase(backing_dev.length() - 1); Loading @@ -478,6 +483,11 @@ static Result<void> KillZramBackingDevice() { << " failed"; } if (!android::base::StartsWith(backing_dev, "/dev/block/loop")) { LOG(INFO) << backing_dev << " is not a loop device. Exiting early"; return {}; } // clear loopback device unique_fd loop(TEMP_FAILURE_RETRY(open(backing_dev.c_str(), O_RDWR | O_CLOEXEC))); if (loop.get() < 0) { Loading Loading
adb/client/incremental_utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <stdint.h> #include <android-base/off64_t.h> namespace incremental { using Size = int64_t; Loading
fs_mgr/fs_mgr.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -358,7 +358,7 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, const struct ext4_super_block* sb, int* fs_stat) { bool has_quota = (sb->s_feature_ro_compat & cpu_to_le32(EXT4_FEATURE_RO_COMPAT_QUOTA)) != 0; bool want_quota = entry.fs_mgr_flags.quota; bool want_projid = android::base::GetBoolProperty("ro.emulated_storage.projid", false); bool want_projid = android::base::GetBoolProperty("external_storage.projid.enabled", false); if (has_quota == want_quota) { return; Loading Loading @@ -521,7 +521,8 @@ static void tune_verity(const std::string& blk_device, const FstabEntry& entry, static void tune_casefold(const std::string& blk_device, const struct ext4_super_block* sb, int* fs_stat) { bool has_casefold = (sb->s_feature_incompat & cpu_to_le32(EXT4_FEATURE_INCOMPAT_CASEFOLD)) != 0; bool wants_casefold = android::base::GetBoolProperty("ro.emulated_storage.casefold", false); bool wants_casefold = android::base::GetBoolProperty("external_storage.casefold.enabled", false); if (!wants_casefold || has_casefold) return; Loading
fs_mgr/fs_mgr_format.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -160,8 +160,8 @@ int fs_mgr_do_format(const FstabEntry& entry, bool crypt_footer) { bool needs_projid = false; if (entry.mount_point == "/data") { needs_casefold = android::base::GetBoolProperty("ro.emulated_storage.casefold", false); needs_projid = android::base::GetBoolProperty("ro.emulated_storage.projid", false); needs_casefold = android::base::GetBoolProperty("external_storage.casefold.enabled", false); needs_projid = android::base::GetBoolProperty("external_storage.projid.enabled", false); } if (entry.fs_type == "f2fs") { Loading
init/reboot.cpp +14 −4 Original line number Diff line number Diff line Loading @@ -203,6 +203,7 @@ static void TurnOffBacklight() { } static Result<void> CallVdc(const std::string& system, const std::string& cmd) { LOG(INFO) << "Calling /system/bin/vdc " << system << " " << cmd; const char* vdc_argv[] = {"/system/bin/vdc", system.c_str(), cmd.c_str()}; int status; if (logwrap_fork_execvp(arraysize(vdc_argv), vdc_argv, &status, false, LOG_KLOG, true, Loading Loading @@ -456,10 +457,14 @@ static UmountStat TryUmountAndFsck(unsigned int cmd, bool run_fsck, #define ZRAM_RESET "/sys/block/zram0/reset" #define ZRAM_BACK_DEV "/sys/block/zram0/backing_dev" static Result<void> KillZramBackingDevice() { if (access(ZRAM_BACK_DEV, F_OK) != 0 && errno == ENOENT) { LOG(INFO) << "No zram backing device configured"; return {}; } std::string backing_dev; if (!android::base::ReadFileToString(ZRAM_BACK_DEV, &backing_dev)) return {}; if (!android::base::StartsWith(backing_dev, "/dev/block/loop")) return {}; if (!android::base::ReadFileToString(ZRAM_BACK_DEV, &backing_dev)) { return ErrnoError() << "Failed to read " << ZRAM_BACK_DEV; } // cut the last "\n" backing_dev.erase(backing_dev.length() - 1); Loading @@ -478,6 +483,11 @@ static Result<void> KillZramBackingDevice() { << " failed"; } if (!android::base::StartsWith(backing_dev, "/dev/block/loop")) { LOG(INFO) << backing_dev << " is not a loop device. Exiting early"; return {}; } // clear loopback device unique_fd loop(TEMP_FAILURE_RETRY(open(backing_dev.c_str(), O_RDWR | O_CLOEXEC))); if (loop.get() < 0) { Loading