summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-24 03:45:30 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-24 04:01:10 +0200
commit8d9f24a65ef27a52615b3225776632de08462eba (patch)
tree76d64437a98e94b2749cbb2f48117f9d1b4af947 /lib/sqfs/blk_proc/internal.h
parent035cbdfe1bc5aea16cbcada5e3c00ecf5ac08c96 (diff)
Move entire fragment processing from data writer to block processor
So far, this is mostly a direct port from the block processor. The actual fragment checksumming is not done through the thread pool. 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.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/sqfs/blk_proc/internal.h b/lib/sqfs/blk_proc/internal.h
index 90a9d91..2e9980b 100644
--- a/lib/sqfs/blk_proc/internal.h
+++ b/lib/sqfs/blk_proc/internal.h
@@ -15,6 +15,7 @@
#include <string.h>
#include <stdlib.h>
+#include <zlib.h>
#ifdef WITH_PTHREAD
#include <pthread.h>
@@ -34,6 +35,12 @@ typedef struct {
uint64_t signature;
} blk_info_t;
+typedef struct {
+ uint32_t index;
+ uint32_t offset;
+ uint64_t signature;
+} frag_info_t;
+
#ifdef WITH_PTHREAD
typedef struct {
@@ -83,6 +90,11 @@ struct sqfs_block_processor_t {
blk_info_t *blocks;
sqfs_compressor_t *cmp;
+ sqfs_block_t *frag_block;
+ frag_info_t *frag_list;
+ size_t frag_list_num;
+ size_t frag_list_max;
+
/* used only by workers */
size_t max_block_size;
@@ -100,8 +112,9 @@ int sqfs_block_process(sqfs_block_t *block, sqfs_compressor_t *cmp,
SQFS_INTERNAL int process_completed_block(sqfs_block_processor_t *proc,
sqfs_block_t *block);
-SQFS_INTERNAL int grow_fragment_table(sqfs_block_processor_t *proc,
- size_t index);
+SQFS_INTERNAL
+int handle_fragment(sqfs_block_processor_t *proc, sqfs_block_t *frag,
+ sqfs_block_t **blk_out);
SQFS_INTERNAL size_t deduplicate_blocks(sqfs_block_processor_t *proc,
size_t count);