Loading fastboot/device/utility.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ bool OpenLogicalPartition(FastbootDevice* device, const std::string& partition_n LOG(ERROR) << "Could not map partition: " << partition_name; return false; } auto closer = [partition_name]() -> void { DestroyLogicalPartition(partition_name, 5s); }; auto closer = [partition_name]() -> void { DestroyLogicalPartition(partition_name); }; *handle = PartitionHandle(dm_path, std::move(closer)); return true; } Loading fs_mgr/fs_mgr.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1331,7 +1331,7 @@ int fs_mgr_umount_all(android::fs_mgr::Fstab* fstab) { continue; } } else if ((current_entry.fs_mgr_flags.verify)) { if (!fs_mgr_teardown_verity(¤t_entry, true /* wait */)) { if (!fs_mgr_teardown_verity(¤t_entry)) { LERROR << "Failed to tear down verified partition on mount point: " << current_entry.mount_point; ret |= FsMgrUmountStatus::ERROR_VERITY; Loading fs_mgr/fs_mgr_dm_linear.cpp +3 −11 Original line number Diff line number Diff line Loading @@ -184,24 +184,16 @@ bool CreateLogicalPartition(const std::string& block_device, uint32_t metadata_s timeout_ms, path); } bool UnmapDevice(const std::string& name, const std::chrono::milliseconds& timeout_ms) { bool UnmapDevice(const std::string& name) { DeviceMapper& dm = DeviceMapper::Instance(); std::string path; if (timeout_ms > std::chrono::milliseconds::zero()) { dm.GetDmDevicePathByName(name, &path); } if (!dm.DeleteDevice(name)) { return false; } if (!path.empty() && !WaitForFileDeleted(path, timeout_ms)) { LERROR << "Timed out waiting for device path to unlink: " << path; return false; } return true; } bool DestroyLogicalPartition(const std::string& name, const std::chrono::milliseconds& timeout_ms) { if (!UnmapDevice(name, timeout_ms)) { bool DestroyLogicalPartition(const std::string& name) { if (!UnmapDevice(name)) { return false; } LINFO << "Unmapped logical partition " << name; Loading fs_mgr/fs_mgr_overlayfs.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -444,7 +444,7 @@ bool fs_mgr_overlayfs_teardown_scratch(const std::string& overlay, bool* change) auto metadata = builder->Export(); if (metadata && UpdatePartitionTable(super_device, *metadata.get(), slot_number)) { if (change) *change = true; if (!DestroyLogicalPartition(partition_name, 0s)) return false; if (!DestroyLogicalPartition(partition_name)) return false; } else { LERROR << "delete partition " << overlay; return false; Loading Loading @@ -844,7 +844,7 @@ static void TruncatePartitionsWithSuffix(MetadataBuilder* builder, const std::st if (!android::base::EndsWith(name, suffix)) { continue; } if (dm.GetState(name) != DmDeviceState::INVALID && !DestroyLogicalPartition(name, 2s)) { if (dm.GetState(name) != DmDeviceState::INVALID && !DestroyLogicalPartition(name)) { continue; } builder->ResizePartition(builder->FindPartition(name), 0); Loading Loading @@ -918,7 +918,7 @@ bool fs_mgr_overlayfs_create_scratch(const Fstab& fstab, std::string* scratch_de return false; } } if (!partition_create) DestroyLogicalPartition(partition_name, 10s); if (!partition_create) DestroyLogicalPartition(partition_name); changed = true; *partition_exists = false; } Loading fs_mgr/fs_mgr_priv.h +2 −2 Original line number Diff line number Diff line Loading @@ -97,10 +97,10 @@ bool is_dt_compatible(); bool fs_mgr_is_ext4(const std::string& blk_device); bool fs_mgr_is_f2fs(const std::string& blk_device); bool fs_mgr_teardown_verity(android::fs_mgr::FstabEntry* fstab, bool wait); bool fs_mgr_teardown_verity(android::fs_mgr::FstabEntry* fstab); namespace android { namespace fs_mgr { bool UnmapDevice(const std::string& name, const std::chrono::milliseconds& timeout_ms); bool UnmapDevice(const std::string& name); } // namespace fs_mgr } // namespace android Loading
fastboot/device/utility.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ bool OpenLogicalPartition(FastbootDevice* device, const std::string& partition_n LOG(ERROR) << "Could not map partition: " << partition_name; return false; } auto closer = [partition_name]() -> void { DestroyLogicalPartition(partition_name, 5s); }; auto closer = [partition_name]() -> void { DestroyLogicalPartition(partition_name); }; *handle = PartitionHandle(dm_path, std::move(closer)); return true; } Loading
fs_mgr/fs_mgr.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1331,7 +1331,7 @@ int fs_mgr_umount_all(android::fs_mgr::Fstab* fstab) { continue; } } else if ((current_entry.fs_mgr_flags.verify)) { if (!fs_mgr_teardown_verity(¤t_entry, true /* wait */)) { if (!fs_mgr_teardown_verity(¤t_entry)) { LERROR << "Failed to tear down verified partition on mount point: " << current_entry.mount_point; ret |= FsMgrUmountStatus::ERROR_VERITY; Loading
fs_mgr/fs_mgr_dm_linear.cpp +3 −11 Original line number Diff line number Diff line Loading @@ -184,24 +184,16 @@ bool CreateLogicalPartition(const std::string& block_device, uint32_t metadata_s timeout_ms, path); } bool UnmapDevice(const std::string& name, const std::chrono::milliseconds& timeout_ms) { bool UnmapDevice(const std::string& name) { DeviceMapper& dm = DeviceMapper::Instance(); std::string path; if (timeout_ms > std::chrono::milliseconds::zero()) { dm.GetDmDevicePathByName(name, &path); } if (!dm.DeleteDevice(name)) { return false; } if (!path.empty() && !WaitForFileDeleted(path, timeout_ms)) { LERROR << "Timed out waiting for device path to unlink: " << path; return false; } return true; } bool DestroyLogicalPartition(const std::string& name, const std::chrono::milliseconds& timeout_ms) { if (!UnmapDevice(name, timeout_ms)) { bool DestroyLogicalPartition(const std::string& name) { if (!UnmapDevice(name)) { return false; } LINFO << "Unmapped logical partition " << name; Loading
fs_mgr/fs_mgr_overlayfs.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -444,7 +444,7 @@ bool fs_mgr_overlayfs_teardown_scratch(const std::string& overlay, bool* change) auto metadata = builder->Export(); if (metadata && UpdatePartitionTable(super_device, *metadata.get(), slot_number)) { if (change) *change = true; if (!DestroyLogicalPartition(partition_name, 0s)) return false; if (!DestroyLogicalPartition(partition_name)) return false; } else { LERROR << "delete partition " << overlay; return false; Loading Loading @@ -844,7 +844,7 @@ static void TruncatePartitionsWithSuffix(MetadataBuilder* builder, const std::st if (!android::base::EndsWith(name, suffix)) { continue; } if (dm.GetState(name) != DmDeviceState::INVALID && !DestroyLogicalPartition(name, 2s)) { if (dm.GetState(name) != DmDeviceState::INVALID && !DestroyLogicalPartition(name)) { continue; } builder->ResizePartition(builder->FindPartition(name), 0); Loading Loading @@ -918,7 +918,7 @@ bool fs_mgr_overlayfs_create_scratch(const Fstab& fstab, std::string* scratch_de return false; } } if (!partition_create) DestroyLogicalPartition(partition_name, 10s); if (!partition_create) DestroyLogicalPartition(partition_name); changed = true; *partition_exists = false; } Loading
fs_mgr/fs_mgr_priv.h +2 −2 Original line number Diff line number Diff line Loading @@ -97,10 +97,10 @@ bool is_dt_compatible(); bool fs_mgr_is_ext4(const std::string& blk_device); bool fs_mgr_is_f2fs(const std::string& blk_device); bool fs_mgr_teardown_verity(android::fs_mgr::FstabEntry* fstab, bool wait); bool fs_mgr_teardown_verity(android::fs_mgr::FstabEntry* fstab); namespace android { namespace fs_mgr { bool UnmapDevice(const std::string& name, const std::chrono::milliseconds& timeout_ms); bool UnmapDevice(const std::string& name); } // namespace fs_mgr } // namespace android