Loading fs_mgr/libsnapshot/include/libsnapshot/snapshot.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -230,8 +230,14 @@ class SnapshotManager final { // devices; // devices; // - CreateResult::ERROR if a fatal error occurred, mounting /system should // - CreateResult::ERROR if a fatal error occurred, mounting /system should // be aborted. // be aborted. // This function mounts /metadata when called, and unmounts /metadata upon // return. CreateResult RecoveryCreateSnapshotDevices(); CreateResult RecoveryCreateSnapshotDevices(); // Same as RecoveryCreateSnapshotDevices(), but does not auto mount/umount // /metadata. CreateResult RecoveryCreateSnapshotDevices(const std::unique_ptr<AutoDevice>& metadata_device); // Dump debug information. // Dump debug information. bool Dump(std::ostream& os); bool Dump(std::ostream& os); Loading fs_mgr/libsnapshot/snapshot.cpp +14 −0 Original line number Original line Diff line number Diff line Loading @@ -2584,6 +2584,20 @@ CreateResult SnapshotManager::RecoveryCreateSnapshotDevices() { LOG(ERROR) << "Couldn't mount Metadata."; LOG(ERROR) << "Couldn't mount Metadata."; return CreateResult::NOT_CREATED; return CreateResult::NOT_CREATED; } } return RecoveryCreateSnapshotDevices(mount); } CreateResult SnapshotManager::RecoveryCreateSnapshotDevices( const std::unique_ptr<AutoDevice>& metadata_device) { if (!device_->IsRecovery()) { LOG(ERROR) << __func__ << " is only allowed in recovery."; return CreateResult::NOT_CREATED; } if (metadata_device == nullptr || !metadata_device->HasDevice()) { LOG(ERROR) << "Metadata not mounted."; return CreateResult::NOT_CREATED; } auto state_file = GetStateFilePath(); auto state_file = GetStateFilePath(); if (access(state_file.c_str(), F_OK) != 0 && errno == ENOENT) { if (access(state_file.c_str(), F_OK) != 0 && errno == ENOENT) { Loading Loading
fs_mgr/libsnapshot/include/libsnapshot/snapshot.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -230,8 +230,14 @@ class SnapshotManager final { // devices; // devices; // - CreateResult::ERROR if a fatal error occurred, mounting /system should // - CreateResult::ERROR if a fatal error occurred, mounting /system should // be aborted. // be aborted. // This function mounts /metadata when called, and unmounts /metadata upon // return. CreateResult RecoveryCreateSnapshotDevices(); CreateResult RecoveryCreateSnapshotDevices(); // Same as RecoveryCreateSnapshotDevices(), but does not auto mount/umount // /metadata. CreateResult RecoveryCreateSnapshotDevices(const std::unique_ptr<AutoDevice>& metadata_device); // Dump debug information. // Dump debug information. bool Dump(std::ostream& os); bool Dump(std::ostream& os); Loading
fs_mgr/libsnapshot/snapshot.cpp +14 −0 Original line number Original line Diff line number Diff line Loading @@ -2584,6 +2584,20 @@ CreateResult SnapshotManager::RecoveryCreateSnapshotDevices() { LOG(ERROR) << "Couldn't mount Metadata."; LOG(ERROR) << "Couldn't mount Metadata."; return CreateResult::NOT_CREATED; return CreateResult::NOT_CREATED; } } return RecoveryCreateSnapshotDevices(mount); } CreateResult SnapshotManager::RecoveryCreateSnapshotDevices( const std::unique_ptr<AutoDevice>& metadata_device) { if (!device_->IsRecovery()) { LOG(ERROR) << __func__ << " is only allowed in recovery."; return CreateResult::NOT_CREATED; } if (metadata_device == nullptr || !metadata_device->HasDevice()) { LOG(ERROR) << "Metadata not mounted."; return CreateResult::NOT_CREATED; } auto state_file = GetStateFilePath(); auto state_file = GetStateFilePath(); if (access(state_file.c_str(), F_OK) != 0 && errno == ENOENT) { if (access(state_file.c_str(), F_OK) != 0 && errno == ENOENT) { Loading