diff options
| author | Yifan Hong <elsk@google.com> | 2020-03-10 10:28:10 -0700 |
|---|---|---|
| committer | Yifan Hong <elsk@google.com> | 2020-03-12 10:01:54 -0700 |
| commit | ec95d5923b91e9a4459b5a75c12bc0f1f7dee92d (patch) | |
| tree | 261b6618f15838ac14d1bbfd4c4bf07f4d9657fe /common/dynamic_partition_control_interface.h | |
| parent | 0c4ed2936e3cfdd61cbdf65d5797255f59d1e6c9 (diff) | |
ShouldSkipOperation -> OptimizeOperation
For SOURCE_COPY operations like
563412 -> 123456
OptimizeOperation optimizes it to
5612 -> 1256
and skip writing blocks that does not need to be written for snapshot
partitions.
Bug: 148623880
Test: update_engine_unittests
Test: apply incremental OTA
Change-Id: Ifd2c3851f703f272a74c8f0e9a1c9a82dbcce3e3
Merged-In: Ifd2c3851f703f272a74c8f0e9a1c9a82dbcce3e3
Diffstat (limited to 'common/dynamic_partition_control_interface.h')
| -rw-r--r-- | common/dynamic_partition_control_interface.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/common/dynamic_partition_control_interface.h b/common/dynamic_partition_control_interface.h index 952e8d4d..a878f2e9 100644 --- a/common/dynamic_partition_control_interface.h +++ b/common/dynamic_partition_control_interface.h @@ -56,12 +56,17 @@ class DynamicPartitionControlInterface { // Return the feature flags of Virtual A/B on this device. virtual FeatureFlag GetVirtualAbFeatureFlag() = 0; - // Checks if |operation| can be skipped on the given partition. + // Attempt to optimize |operation|. + // If successful, |optimized| contains an operation with extents that + // needs to be written. + // If failed, no optimization is available, and caller should perform + // |operation| directly. // |partition_name| should not have the slot suffix; implementation of // DynamicPartitionControlInterface checks partition at the target slot // previously set with PreparePartitionsForUpdate(). - virtual bool ShouldSkipOperation(const std::string& partition_name, - const InstallOperation& operation) = 0; + virtual bool OptimizeOperation(const std::string& partition_name, + const InstallOperation& operation, + InstallOperation* optimized) = 0; // Do necessary cleanups before destroying the object. virtual void Cleanup() = 0; |
