diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-24 03:45:30 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-24 04:01:10 +0200 |
commit | 8d9f24a65ef27a52615b3225776632de08462eba (patch) | |
tree | 76d64437a98e94b2749cbb2f48117f9d1b4af947 /lib/sqfs/blk_proc/internal.h | |
parent | 035cbdfe1bc5aea16cbcada5e3c00ecf5ac08c96 (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.h | 17 |
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); |