From 4249e123d321650050259fb602f06497519077d0 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 14 Jan 2021 04:38:33 +0100 Subject: 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 --- include/hash_table.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/hash_table.h') diff --git a/include/hash_table.h b/include/hash_table.h index 6f377c9..813e059 100644 --- a/include/hash_table.h +++ b/include/hash_table.h @@ -42,9 +42,10 @@ struct hash_entry { struct hash_table { struct hash_entry *table; - sqfs_u32 (*key_hash_function)(const void *key); - bool (*key_equals_function)(const void *a, const void *b); + sqfs_u32 (*key_hash_function)(void *user, const void *key); + bool (*key_equals_function)(void *user, const void *a, const void *b); const void *deleted_key; + void *user; sqfs_u32 size; sqfs_u32 rehash; sqfs_u64 size_magic; @@ -56,8 +57,8 @@ struct hash_table { }; SQFS_INTERNAL struct hash_table * -hash_table_create(sqfs_u32 (*key_hash_function)(const void *key), - bool (*key_equals_function)(const void *a, +hash_table_create(sqfs_u32 (*key_hash_function)(void *user, const void *key), + bool (*key_equals_function)(void *user, const void *a, const void *b)); SQFS_INTERNAL struct hash_table * -- cgit v1.2.3