summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/process_block.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/blk_proc/process_block.c')
-rw-r--r--lib/sqfs/blk_proc/process_block.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/sqfs/blk_proc/process_block.c b/lib/sqfs/blk_proc/process_block.c
index ccc6df0..78de31b 100644
--- a/lib/sqfs/blk_proc/process_block.c
+++ b/lib/sqfs/blk_proc/process_block.c
@@ -47,69 +47,6 @@ static int allign_file(sqfs_block_processor_t *proc, sqfs_block_t *blk)
proc->devblksz);
}
-static int store_block_location(sqfs_block_processor_t *proc, uint64_t offset,
- uint32_t size, uint32_t chksum)
-{
- size_t new_sz;
- void *new;
-
- if (proc->num_blocks == proc->max_blocks) {
- new_sz = proc->max_blocks * 2;
- new = realloc(proc->blocks, sizeof(proc->blocks[0]) * new_sz);
-
- if (new == NULL)
- return SQFS_ERROR_ALLOC;
-
- proc->blocks = new;
- proc->max_blocks = new_sz;
- }
-
- proc->blocks[proc->num_blocks].offset = offset;
- proc->blocks[proc->num_blocks].signature = MK_BLK_SIG(chksum, size);
- proc->num_blocks += 1;
- return 0;
-}
-
-static size_t deduplicate_blocks(sqfs_block_processor_t *proc, size_t count)
-{
- size_t i, j;
-
- for (i = 0; i < proc->file_start; ++i) {
- for (j = 0; j < count; ++j) {
- if (proc->blocks[i + j].signature !=
- proc->blocks[proc->file_start + j].signature)
- break;
- }
-
- if (j == count)
- break;
- }
-
- return i;
-}
-
-static size_t grow_fragment_table(sqfs_block_processor_t *proc, size_t index)
-{
- size_t newsz;
- void *new;
-
- if (index < proc->max_fragments)
- return 0;
-
- do {
- newsz = proc->max_fragments ? proc->max_fragments * 2 : 16;
- } while (index >= newsz);
-
- new = realloc(proc->fragments, sizeof(proc->fragments[0]) * newsz);
-
- if (new == NULL)
- return SQFS_ERROR_ALLOC;
-
- proc->max_fragments = newsz;
- proc->fragments = new;
- return 0;
-}
-
int process_completed_block(sqfs_block_processor_t *proc, sqfs_block_t *blk)
{
size_t start, count;