mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 09:56:29 -05:00
Implements an incremental rehash.
This commit is contained in:
parent
2fdcecf350
commit
275ef2ed3c
17 changed files with 473 additions and 338 deletions
4
import.h
4
import.h
|
|
@ -33,9 +33,11 @@ struct snapraid_import_block {
|
|||
unsigned size; /**< Size of the block. */
|
||||
data_off_t offset; /**< Position of the block in the file. */
|
||||
unsigned char hash[HASH_SIZE]; /**< Hash of the block. */
|
||||
unsigned char prevhash[HASH_SIZE]; /**< Previous hash of the block. Valid only if we are in rehash state. */
|
||||
|
||||
/* nodes for data structures */
|
||||
tommy_hashdyn_node nodeset;
|
||||
tommy_hashdyn_node prevnodeset;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -61,7 +63,7 @@ void import_file_free(struct snapraid_import_file* file);
|
|||
* Fetch a block from the specified hash.
|
||||
* Return ==0 if the block is found, and copied into buffer.
|
||||
*/
|
||||
int state_import_fetch(struct snapraid_state* state, const unsigned char* hash, unsigned char* buffer);
|
||||
int state_import_fetch(struct snapraid_state* state, int prevhash, const unsigned char* hash, unsigned char* buffer);
|
||||
|
||||
/**
|
||||
* Import files from the specified directory.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue