aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-01-14 04:38:33 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-01-19 10:45:59 +0100
commit4249e123d321650050259fb602f06497519077d0 (patch)
tree9638c0fb1d5735d2e3b0d044e991641754e97d36 /lib/sqfs/block_processor/internal.h
parent854119c62621e017c13be5192a9494c0eea2fe2f (diff)
libsqfs: block processor: backport exact fragment matching
This commit is an amalgamation of the commits on master that implement exact matching of fragment blocks during deduplication. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor/internal.h')
-rw-r--r--lib/sqfs/block_processor/internal.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h
index ee76946..4699dc6 100644
--- a/lib/sqfs/block_processor/internal.h
+++ b/lib/sqfs/block_processor/internal.h
@@ -26,8 +26,7 @@
#include <stdlib.h>
#include <assert.h>
-typedef struct chunk_info_t {
- struct chunk_info_t *next;
+typedef struct {
sqfs_u32 index;
sqfs_u32 offset;
sqfs_u32 size;
@@ -82,6 +81,13 @@ struct sqfs_block_processor_t {
bool begin_called;
+ sqfs_file_t *file;
+ sqfs_compressor_t *uncmp;
+ sqfs_block_t *frag_cmp_current;
+ sqfs_u8 *frag_buffer;
+ sqfs_u32 buffered_index;
+ sqfs_u32 buffered_blk_size;
+
int (*process_completed_block)(sqfs_block_processor_t *proc,
sqfs_block_t *block);
@@ -92,6 +98,10 @@ struct sqfs_block_processor_t {
int (*process_block)(sqfs_block_t *block, sqfs_compressor_t *cmp,
sqfs_u8 *scratch, size_t scratch_size);
+ int (*compare_frag_in_flight)(sqfs_block_processor_t *proc,
+ sqfs_block_t *frag, sqfs_u32 index,
+ sqfs_u32 offset);
+
int (*append_to_work_queue)(sqfs_block_processor_t *proc,
sqfs_block_t *block);
@@ -101,9 +111,6 @@ struct sqfs_block_processor_t {
SQFS_INTERNAL void block_processor_cleanup(sqfs_block_processor_t *base);
SQFS_INTERNAL int block_processor_init(sqfs_block_processor_t *base,
- size_t max_block_size,
- sqfs_compressor_t *cmp,
- sqfs_block_writer_t *wr,
- sqfs_frag_table_t *tbl);
+ const sqfs_block_processor_desc_t *desc);
#endif /* INTERNAL_H */