mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Centralize canonical SnapRAID block hashing semantics
This commit is contained in:
parent
0ab885d8e5
commit
1a5b5728d2
7 changed files with 87 additions and 33 deletions
|
|
@ -701,13 +701,13 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
|
|||
* same position may still fail verification.
|
||||
*/
|
||||
if (rehash) {
|
||||
memhash(state->prevhash, state->prevhashseed, hash, buffer[diskcur], read_size);
|
||||
memhash_block(state->prevhash, state->prevhashseed, hash, buffer[diskcur], read_size, state->block_size);
|
||||
|
||||
/* compute the new hash, and store it */
|
||||
rehandle[diskcur].block = block;
|
||||
memhash(state->hash, state->hashseed, rehandle[diskcur].hash, buffer[diskcur], read_size);
|
||||
memhash_block(state->hash, state->hashseed, rehandle[diskcur].hash, buffer[diskcur], read_size, state->block_size);
|
||||
} else {
|
||||
memhash(state->hash, state->hashseed, hash, buffer[diskcur], read_size);
|
||||
memhash_block(state->hash, state->hashseed, hash, buffer[diskcur], read_size, state->block_size);
|
||||
}
|
||||
|
||||
/* until now is hash */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue