diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-14 15:54:39 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-15 18:09:43 +0100 |
commit | 892066b0477186801d290953a9b994df353f8dbb (patch) | |
tree | 4e142a477da949f99da0697368f29fad3731b250 /lib/sqfs/block_processor/serial.c | |
parent | 81c47bee5b554688aaeaedc9d8453a676b9a9107 (diff) |
Cleanup: block processor: move finish function back into implementations
The "generic" version actually uses specific internals of the thread
pool implementation. Move it back into the thread pool based
implementation and simplify the serial processor.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor/serial.c')
-rw-r--r-- | lib/sqfs/block_processor/serial.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/sqfs/block_processor/serial.c b/lib/sqfs/block_processor/serial.c index dce7490..b1e1823 100644 --- a/lib/sqfs/block_processor/serial.c +++ b/lib/sqfs/block_processor/serial.c @@ -77,3 +77,22 @@ int wait_completed(sqfs_block_processor_t *proc) { return proc->status; } + +int sqfs_block_processor_finish(sqfs_block_processor_t *proc) +{ + if (proc->frag_block != NULL && proc->status == 0) { + proc->status = block_processor_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; +} |