libsparse: merge adjacent blocks of the same type
When a block is added that is adjacent to another block and of the same
type, merge it. This will be useful for converting regular images to
sparse images, allowing the reader to add a single block at a time and
letting libsparse optimize into larger blocks as it goes.
Does not support merge two blocks that are backed by a data pointer,
only blocks that are backed by a file for now.
Change-Id: I95aa231714cbe01ac194e868c21385806c0bdb97
diff --git a/libsparse/sparse.c b/libsparse/sparse.c
index 3403604..d778e1d 100644
--- a/libsparse/sparse.c
+++ b/libsparse/sparse.c
@@ -32,7 +32,7 @@
return NULL;
}
- s->backed_block_list = backed_block_list_new();
+ s->backed_block_list = backed_block_list_new(block_size);
if (!s->backed_block_list) {
free(s);
return NULL;