diff options
author | Yifan Hong <elsk@google.com> | 2020-03-10 10:28:10 -0700 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2020-03-10 18:22:24 -0700 |
commit | f526156e5fbc46203d097cdaa11f51df2eafae54 (patch) | |
tree | f2da6ca0b753248a7acfabe709abe9270734714b /common/dynamic_partition_control_interface.h | |
parent | 0f821c70b88e088fe9794cda9251b3a92d27444e (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
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; |