aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/block_processor/serial.c')
-rw-r--r--lib/sqfs/block_processor/serial.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/sqfs/block_processor/serial.c b/lib/sqfs/block_processor/serial.c
index 4d6b3ec..daa11fe 100644
--- a/lib/sqfs/block_processor/serial.c
+++ b/lib/sqfs/block_processor/serial.c
@@ -61,27 +61,29 @@ static int block_processor_sync(sqfs_block_processor_t *proc)
return ((serial_block_processor_t *)proc)->status;
}
-sqfs_block_processor_t *sqfs_block_processor_create(size_t max_block_size,
- sqfs_compressor_t *cmp,
- unsigned int num_workers,
- size_t max_backlog,
- sqfs_block_writer_t *wr,
- sqfs_frag_table_t *tbl)
+int sqfs_block_processor_create_ex(const sqfs_block_processor_desc_t *desc,
+ sqfs_block_processor_t **out)
{
serial_block_processor_t *proc;
- (void)num_workers; (void)max_backlog;
+ int ret;
- proc = alloc_flex(sizeof(*proc), 1, max_block_size);
+ if (desc->size != sizeof(sqfs_block_processor_desc_t))
+ return SQFS_ERROR_ARG_INVALID;
+
+ proc = alloc_flex(sizeof(*proc), 1, desc->max_block_size);
if (proc == NULL)
- return NULL;
+ return SQFS_ERROR_ALLOC;
- if (block_processor_init(&proc->base, max_block_size, cmp, wr, tbl)) {
+ ret = block_processor_init(&proc->base, desc);
+ if (ret != 0) {
free(proc);
- return NULL;
+ return ret;
}
proc->base.sync = block_processor_sync;
proc->base.append_to_work_queue = append_to_work_queue;
((sqfs_object_t *)proc)->destroy = block_processor_destroy;
- return (sqfs_block_processor_t *)proc;
+
+ *out = (sqfs_block_processor_t *)proc;
+ return 0;
}