diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-26 22:06:04 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-28 16:33:57 +0200 |
commit | 8b633067948a30a0d45091afcced0392dd28d105 (patch) | |
tree | d3cfdd43132da1cee604bd18b3569bd19ba8fdd8 /lib/sqfs/tree_node_from_inode.c | |
parent | 0f1bedc90f4cb71d965e99446cf3e72a45909346 (diff) |
Add fragment and block checksum fields to file_info_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/tree_node_from_inode.c')
-rw-r--r-- | lib/sqfs/tree_node_from_inode.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/sqfs/tree_node_from_inode.c b/lib/sqfs/tree_node_from_inode.c index f35c046..034218c 100644 --- a/lib/sqfs/tree_node_from_inode.c +++ b/lib/sqfs/tree_node_from_inode.c @@ -38,13 +38,13 @@ static size_t compute_size(sqfs_inode_generic_t *inode, const char *name, break; } - return size + block_count * sizeof(uint32_t); + return size + block_count * sizeof(((file_info_t *)0)->blocks[0]); } static void copy_block_sizes(sqfs_inode_generic_t *inode, tree_node_t *out, size_t block_size) { - size_t block_count = out->data.file->size / block_size; + size_t i, block_count = out->data.file->size / block_size; if ((out->data.file->size % block_size) != 0) { if (out->data.file->fragment == 0xFFFFFFFF || @@ -53,12 +53,10 @@ static void copy_block_sizes(sqfs_inode_generic_t *inode, tree_node_t *out, } } - out->name += block_count * sizeof(uint32_t); + out->name += block_count * sizeof(out->data.file->blocks[0]); - if (block_count) { - memcpy(out->data.file->blocksizes, inode->block_sizes, - block_count * sizeof(uint32_t)); - } + for (i = 0; i < block_count; ++i) + out->data.file->blocks[i].size = inode->block_sizes[i]; } tree_node_t *tree_node_from_inode(sqfs_inode_generic_t *inode, |