From f57814332a69bebc40e25e6537a3c08fc9e18f97 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 14 Sep 2019 01:41:38 +0200 Subject: Move data deduplication from fstree code to data writer Signed-off-by: David Oberhollenzer --- include/fstree.h | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'include/fstree.h') diff --git a/include/fstree.h b/include/fstree.h index 7ee105b..8d0b952 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -99,18 +99,12 @@ struct file_info_t { /* Byte offset into the fragment block. */ uint32_t fragment_offset; - uint32_t fragment_chksum; - /* combination of FILE_FLAG_* flags */ uint32_t flags; /* Stores data about each full data block. */ - struct { - uint32_t chksum; - - /* Bit (1 << 24) is set if the block is stored uncompressed. */ - uint32_t size; - } blocks[]; + /* Bit (1 << 24) is set if the block is stored uncompressed. */ + uint32_t block_size[]; }; /* Additional meta data stored in a tree_node_t for directories */ @@ -311,25 +305,6 @@ void tree_node_sort_recursive(tree_node_t *root); /* resolve a path to a tree node. Returns NULL on failure and sets errno */ tree_node_t *fstree_node_from_path(fstree_t *fs, const char *path); -/* - Walk through 'list' to find a file with a fragment that has - the same size ('frag_size') and checksum ('chksum') as 'fi'. - - Returns NULL if no such fragment could be found. -*/ -file_info_t *fragment_by_chksum(file_info_t *fi, uint32_t chksum, - size_t frag_size, file_info_t *list, - size_t block_size); - -/* - Walk through 'list' to find a file that contains the same sequence of blocks - as 'file', comparing size and checksum. - - Returns NULL if no such fragment could be found. - */ -uint64_t find_equal_blocks(file_info_t *file, file_info_t *list, - size_t block_size); - /* Optimize the order of the fstree file list for unpacking as to avoid unpacking fragment blocks more than once and to improve locality when -- cgit v1.2.3