aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 06:37:26 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 06:37:26 +0200
commitd58ec4c9a11987e37bf158760bd18294f293beea (patch)
tree745b3ebe6e4372c421cdcaca983993222a83ca31
parent762319a6c51ae354334182751b5d6c6bd364e5b0 (diff)
Minor cleanup on fragment handling code
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--lib/sqfs/blk_proc/fragtbl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/sqfs/blk_proc/fragtbl.c b/lib/sqfs/blk_proc/fragtbl.c
index c8a3397..2467036 100644
--- a/lib/sqfs/blk_proc/fragtbl.c
+++ b/lib/sqfs/blk_proc/fragtbl.c
@@ -28,8 +28,7 @@ static int grow_fragment_table(sqfs_block_processor_t *proc)
return 0;
}
-static int store_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
- uint64_t signature)
+static int grow_deduplication_list(sqfs_block_processor_t *proc)
{
size_t new_sz;
void *new;
@@ -46,6 +45,17 @@ static int store_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
proc->frag_list_max = new_sz;
}
+ return 0;
+}
+
+static int store_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
+ uint64_t signature)
+{
+ int err = grow_deduplication_list(proc);
+
+ if (err)
+ return err;
+
proc->frag_list[proc->frag_list_num].index = proc->frag_block->index;
proc->frag_list[proc->frag_list_num].offset = proc->frag_block->size;
proc->frag_list[proc->frag_list_num].signature = signature;