summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 06:03:36 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 06:35:01 +0200
commit3da78a56df43360520f8007bdb4e11fa25f712cc (patch)
treef1dfd2ca166909ac3a9c37d8ec5196b11a548bb0 /lib/sqfs/blk_proc/internal.h
parentb6400d20cc64afff22d2805c58dc04f2234d38a5 (diff)
Refactor out common code of the block processors
Code that already is shared between the pthread and the serial processor as well as code that can be re-used by other threading API implementations. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/blk_proc/internal.h')
-rw-r--r--lib/sqfs/blk_proc/internal.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/sqfs/blk_proc/internal.h b/lib/sqfs/blk_proc/internal.h
index 2e9980b..5fdbc3e 100644
--- a/lib/sqfs/blk_proc/internal.h
+++ b/lib/sqfs/blk_proc/internal.h
@@ -64,7 +64,6 @@ struct sqfs_block_processor_t {
sqfs_block_t *queue_last;
sqfs_block_t *done;
- bool terminate;
size_t backlog;
int status;
@@ -105,10 +104,6 @@ struct sqfs_block_processor_t {
#endif
};
-SQFS_INTERNAL
-int sqfs_block_process(sqfs_block_t *block, sqfs_compressor_t *cmp,
- uint8_t *scratch, size_t scratch_size);
-
SQFS_INTERNAL int process_completed_block(sqfs_block_processor_t *proc,
sqfs_block_t *block);
@@ -123,4 +118,25 @@ SQFS_INTERNAL int store_block_location(sqfs_block_processor_t *proc,
uint64_t offset, uint32_t size,
uint32_t chksum);
+SQFS_INTERNAL void free_blk_list(sqfs_block_t *list);
+
+SQFS_INTERNAL
+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, size_t devblksz,
+ sqfs_file_t *file);
+
+SQFS_INTERNAL void block_processor_cleanup(sqfs_block_processor_t *proc);
+
+SQFS_INTERNAL
+void block_processor_store_done(sqfs_block_processor_t *proc,
+ sqfs_block_t *blk, int status);
+
+SQFS_INTERNAL
+sqfs_block_t *block_processor_next_work_item(sqfs_block_processor_t *proc);
+
+SQFS_INTERNAL
+int block_processor_do_block(sqfs_block_t *block, sqfs_compressor_t *cmp,
+ uint8_t *scratch, size_t scratch_size);
+
#endif /* INTERNAL_H */