add option to make_ext4fs to record blocks for each file
Add the -B option to make_ext4fs, which causes it to record the block
ranges used for each (regular) file in the image. We can use this
information to construct more efficient block-based incremental OTAs.
Bug: 16984795
Change-Id: I2a5325bb89948f63c76e93fdfa84c51f9b050104
diff --git a/ext4_utils/extent.c b/ext4_utils/extent.c
index abb30ce..7142c8b 100644
--- a/ext4_utils/extent.c
+++ b/ext4_utils/extent.c
@@ -202,7 +202,7 @@
/* Allocates enough blocks to hold len bytes, queues them to be written
from a file, and connects them to an inode. */
-void inode_allocate_file_extents(struct ext4_inode *inode, u64 len,
+struct block_allocation* inode_allocate_file_extents(struct ext4_inode *inode, u64 len,
const char *filename)
{
struct block_allocation *alloc;
@@ -214,8 +214,7 @@
}
extent_create_backing_file(alloc, len, filename);
-
- free_alloc(alloc);
+ return alloc;
}
/* Allocates enough blocks to hold len bytes and connects them to an inode */