summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/process_block.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-21 00:04:12 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-21 00:13:24 +0200
commit544575bd09378dcf573e33a315628ecc193925e7 (patch)
treed5deb8b2e8a21ea9169f18b88dabfdc34363a789 /lib/sqfs/blk_proc/process_block.c
parent79498fa15227d4659489763ed2a9a1e806c11428 (diff)
Merge some of serial & pthread block processor code paths/declarations
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/blk_proc/process_block.c')
-rw-r--r--lib/sqfs/blk_proc/process_block.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/sqfs/blk_proc/process_block.c b/lib/sqfs/blk_proc/process_block.c
index 0eae244..1b6ee29 100644
--- a/lib/sqfs/blk_proc/process_block.c
+++ b/lib/sqfs/blk_proc/process_block.c
@@ -36,3 +36,23 @@ int sqfs_block_process(sqfs_block_t *block, sqfs_compressor_t *cmp,
return 0;
}
+
+int process_completed_blocks(sqfs_block_processor_t *proc, sqfs_block_t *queue)
+{
+ sqfs_block_t *it;
+
+ while (queue != NULL) {
+ it = queue;
+ queue = queue->next;
+
+ if (it->flags & SQFS_BLK_COMPRESS_ERROR) {
+ proc->status = SQFS_ERROR_COMRPESSOR;
+ } else if (proc->status == 0) {
+ proc->status = proc->cb(proc->user, it);
+ }
+
+ free(it);
+ }
+
+ return proc->status;
+}