update_engine: Remove sparse hole extents.
Whenever there is an extent beginning with a sparse hole, that extent
will be filtered out. Extents are now read in from the partition rather
than the file itself in ReadFileToDiff. src/dst_length are set to the
number of blocks in src/dst_extents * block_size.
This was tested manually with _GenerateSinglePayload to generate a delta
payload between test images.
BUG=chromium:469792,chromium:474497
TEST=`FEATURES=test emerge-link update_engine` and manual testing.
Change-Id: I384ec3f16f7fd9087159817358308f22d29e9edf
Reviewed-on: https://chromium-review.googlesource.com/264442
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Commit-Queue: Allie Wood <alliewood@chromium.org>
Tested-by: Allie Wood <alliewood@chromium.org>
diff --git a/update_metadata.proto b/update_metadata.proto
index 923ea26..f99c912 100644
--- a/update_metadata.proto
+++ b/update_metadata.proto
@@ -130,15 +130,14 @@
// Ordered list of extents that are read from (if any) and written to.
repeated Extent src_extents = 4;
- // Byte length of src, not necessarily block aligned. It's only used for
- // BSDIFF, because we need to pass that external program the number
- // of bytes to read from the blocks we pass it.
+ // Byte length of src, equal to the number of blocks in src_extents *
+ // block_size. It is used for BSDIFF, because we need to pass that
+ // external program the number of bytes to read from the blocks we pass it.
optional uint64 src_length = 5;
repeated Extent dst_extents = 6;
- // byte length of dst, not necessarily block aligned. It's only used for
- // BSDIFF, because we need to fill in the rest of the last block
- // that bsdiff writes with '\0' bytes.
+ // Byte length of dst, equal to the number of blocks in dst_extents *
+ // block_size. Used for BSDIFF.
optional uint64 dst_length = 7;
// Optional SHA 256 hash of the blob associated with this operation.