Revert "remount: Remove the "backing" parameter to fs_mgr_overlayfs_setup."

This reverts commit b20aa434a3.

Bug: 146403375
Reason for revert: broken build 6078429 on git_master on walleye-user

Change-Id: Idc3b1c0ad5228d63298ce84811624b23d0cea434
This commit is contained in:
Ed Chen 2019-12-17 08:53:13 +00:00
parent b20aa434a3
commit 1981401909
4 changed files with 8 additions and 6 deletions

View file

@ -1178,7 +1178,8 @@ std::vector<std::string> fs_mgr_overlayfs_required_devices(Fstab* fstab) {
// Returns false if setup not permitted, errno set to last error.
// If something is altered, set *change.
bool fs_mgr_overlayfs_setup(const char* mount_point, bool* change, bool force) {
bool fs_mgr_overlayfs_setup(const char* backing, const char* mount_point, bool* change,
bool force) {
if (change) *change = false;
auto ret = false;
if (fs_mgr_overlayfs_valid() == OverlayfsValidResult::kNotSupported) return ret;
@ -1215,6 +1216,7 @@ bool fs_mgr_overlayfs_setup(const char* mount_point, bool* change, bool force) {
std::string dir;
for (const auto& overlay_mount_point : kOverlayMountPoints) {
if (backing && backing[0] && (overlay_mount_point != backing)) continue;
if (overlay_mount_point == kScratchMountPoint) {
if (!fs_mgr_overlayfs_setup_scratch(fstab, change)) continue;
} else {

View file

@ -277,7 +277,7 @@ static int do_remount(int argc, char* argv[]) {
auto change = false;
errno = 0;
if (fs_mgr_overlayfs_setup(mount_point.c_str(), &change, just_disabled_verity)) {
if (fs_mgr_overlayfs_setup(nullptr, mount_point.c_str(), &change, just_disabled_verity)) {
if (change) {
LOG(INFO) << "Using overlayfs for " << mount_point;
reboot_later = can_reboot;

View file

@ -25,8 +25,8 @@ android::fs_mgr::Fstab fs_mgr_overlayfs_candidate_list(const android::fs_mgr::Fs
bool fs_mgr_overlayfs_mount_all(android::fs_mgr::Fstab* fstab);
std::vector<std::string> fs_mgr_overlayfs_required_devices(android::fs_mgr::Fstab* fstab);
bool fs_mgr_overlayfs_setup(const char* mount_point = nullptr, bool* change = nullptr,
bool force = true);
bool fs_mgr_overlayfs_setup(const char* backing = nullptr, const char* mount_point = nullptr,
bool* change = nullptr, bool force = true);
bool fs_mgr_overlayfs_teardown(const char* mount_point = nullptr, bool* change = nullptr);
bool fs_mgr_overlayfs_is_setup();
bool fs_mgr_has_shared_blocks(const std::string& mount_point, const std::string& dev);

View file

@ -101,7 +101,7 @@ static bool set_verity_enabled_state(const char* block_device, const char* mount
auto change = false;
errno = 0;
if (enable ? fs_mgr_overlayfs_teardown(mount_point, &change)
: fs_mgr_overlayfs_setup(mount_point, &change)) {
: fs_mgr_overlayfs_setup(nullptr, mount_point, &change)) {
if (change) {
printf("%s overlayfs for %s\n", enable ? "disabling" : "using", mount_point);
}
@ -132,7 +132,7 @@ static bool overlayfs_setup(bool enable) {
auto change = false;
errno = 0;
if (enable ? fs_mgr_overlayfs_teardown(nullptr, &change)
: fs_mgr_overlayfs_setup(nullptr, &change)) {
: fs_mgr_overlayfs_setup(nullptr, nullptr, &change)) {
if (change) {
printf("%s overlayfs\n", enable ? "disabling" : "using");
}