diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-14 01:41:38 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-14 04:10:45 +0200 |
commit | f57814332a69bebc40e25e6537a3c08fc9e18f97 (patch) | |
tree | 7ff880b8eb53f4852c6f0be9436f220643219795 /include | |
parent | d455ff92da0249e731cff7613f42b0f7359775da (diff) |
Move data deduplication from fstree code to data writer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/fstree.h | 29 |
1 files changed, 2 insertions, 27 deletions
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 */ @@ -312,25 +306,6 @@ void tree_node_sort_recursive(tree_node_t *root); 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 fetching data from disk. The resulting list is returned in 'out'. |