summaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer/serial.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-13 02:00:36 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-13 02:05:42 +0100
commit514e9e500abdd8ea91ea3b2fca214587ee24a342 (patch)
tree6a6ae1efad3cbd073725b4dbc507259121083139 /lib/sqfs/data_writer/serial.c
parent74f25ae0f3ebc1cd435f29c21ab164a9028af980 (diff)
Cleanup data writer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/data_writer/serial.c')
-rw-r--r--lib/sqfs/data_writer/serial.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/sqfs/data_writer/serial.c b/lib/sqfs/data_writer/serial.c
index 916f497..82f7836 100644
--- a/lib/sqfs/data_writer/serial.c
+++ b/lib/sqfs/data_writer/serial.c
@@ -43,11 +43,13 @@ int test_and_set_status(sqfs_data_writer_t *proc, int status)
return proc->status;
}
-int data_writer_enqueue(sqfs_data_writer_t *proc, sqfs_block_t *block)
+int append_to_work_queue(sqfs_data_writer_t *proc, sqfs_block_t *block,
+ bool signal_threads)
{
sqfs_block_t *fragblk = NULL;
+ (void)signal_threads;
- if (proc->status != 0) {
+ if (proc->status != 0 || block == NULL) {
free(block);
return proc->status;
}
@@ -80,19 +82,7 @@ int data_writer_enqueue(sqfs_data_writer_t *proc, sqfs_block_t *block)
return proc->status;
}
-int sqfs_data_writer_finish(sqfs_data_writer_t *proc)
+int wait_completed(sqfs_data_writer_t *proc)
{
- if (proc->status != 0 || proc->frag_block == NULL)
- return proc->status;
-
- proc->status = data_writer_do_block(proc->frag_block, proc->cmp,
- proc->scratch,
- proc->max_block_size);
-
- if (proc->status == 0)
- proc->status = process_completed_block(proc, proc->frag_block);
-
- free(proc->frag_block);
- proc->frag_block = NULL;
return proc->status;
}