From 947670d992454033a13c70e36a53a2ac10b3d6ad Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 23 Mar 2021 11:32:04 +0100 Subject: block processor: Re-implement exact fragment matching In the hash-table equals callback, if the hash and size match, do an exact, byte-for-byte comparison of the fragment in question. The fragment can either be in a fragment block that is in-flight (for which we have the in-flight list), in the current, unfinished fragment block, or it can be on disk. In the later case, the fragment block is resolved through the fragment table and read back from disk into a scratch buffer and decompressed. After that, the fragment is checked for byte-for-byte equality with the one we resolved through the hash table. Signed-off-by: David Oberhollenzer --- lib/sqfs/block_processor/internal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sqfs/block_processor/internal.h') diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h index 72e862a..1c184c5 100644 --- a/lib/sqfs/block_processor/internal.h +++ b/lib/sqfs/block_processor/internal.h @@ -99,7 +99,12 @@ struct sqfs_block_processor_t { sqfs_u32 io_seq_num; sqfs_u32 io_deq_seq_num; + sqfs_block_t *current_frag; + sqfs_block_t *cached_frag_blk; sqfs_block_t *fblk_in_flight; + int fblk_lookup_error; + + sqfs_u8 scratch[]; }; SQFS_INTERNAL int enqueue_block(sqfs_block_processor_t *proc, -- cgit v1.2.3