Implement ZERO and DISCARD operations in update_engine.
ZERO and DISCARD operations are implemented using the specific ioctl()
that allow SSD to do a faster operation when writing zeros. In case of
failure, such as when they are not supported, the operation will fall
back to write the zeros directly.
Bug: 23180264
Test: Added a unittest.
Change-Id: I0f12ab9864620b50250157c1de17b7fc58c7ea1c
diff --git a/delta_performer.h b/delta_performer.h
index 8345174..34cb137 100644
--- a/delta_performer.h
+++ b/delta_performer.h
@@ -279,6 +279,8 @@
// These perform a specific type of operation and return true on success.
bool PerformReplaceOperation(const InstallOperation& operation,
bool is_kernel_partition);
+ bool PerformZeroOrDiscardOperation(const InstallOperation& operation,
+ bool is_kernel_partition);
bool PerformMoveOperation(const InstallOperation& operation,
bool is_kernel_partition);
bool PerformBsdiffOperation(const InstallOperation& operation,