diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-14 17:56:40 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-02-15 19:24:59 +0100 |
commit | 9ac42164bc43bcdd47c0a8e5e59c662b2a136659 (patch) | |
tree | 4a2a18f859e41a3b4c2e4c1a1e0ab84e5953d5e5 /lib/sqfs/block_processor/common.c | |
parent | 892066b0477186801d290953a9b994df353f8dbb (diff) |
Cleanup: block processor: move init/cleanup functions into implemenations
Again, the generic init/cleanup functions do way too many things that
are specific to the thread pool implementation. Thanks to the splitting
up of the block processor, they also have become quite trivial. This
commit moves those functions into their respective implementations,
allowing even further simplificiation.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor/common.c')
-rw-r--r-- | lib/sqfs/block_processor/common.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/sqfs/block_processor/common.c b/lib/sqfs/block_processor/common.c index e2d92c5..c8dbbc2 100644 --- a/lib/sqfs/block_processor/common.c +++ b/lib/sqfs/block_processor/common.c @@ -7,43 +7,6 @@ #define SQFS_BUILDING_DLL #include "internal.h" -void free_blk_list(sqfs_block_t *list) -{ - sqfs_block_t *it; - - while (list != NULL) { - it = list; - list = list->next; - free(it); - } -} - -int block_processor_init(sqfs_block_processor_t *proc, 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) -{ - proc->max_block_size = max_block_size; - proc->num_workers = num_workers; - proc->max_backlog = max_backlog; - proc->cmp = cmp; - proc->frag_tbl = tbl; - proc->wr = wr; - - memset(&proc->stats, 0, sizeof(proc->stats)); - proc->stats.size = sizeof(proc->stats); - return 0; -} - -void block_processor_cleanup(sqfs_block_processor_t *proc) -{ - free_blk_list(proc->queue); - free_blk_list(proc->done); - free(proc->blk_current); - free(proc->frag_block); - free(proc); -} - int process_completed_block(sqfs_block_processor_t *proc, sqfs_block_t *blk) { sqfs_u64 location; |