mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Changes the argument format of raid_rec() and renames raid_par() to raid_gen().
This commit is contained in:
parent
365b4127c0
commit
00a05a80e5
15 changed files with 363 additions and 390 deletions
10
check.c
10
check.c
|
|
@ -112,7 +112,7 @@ static int is_hash_matching(struct snapraid_state* state, int rehash, unsigned d
|
|||
/* if we checked something, and no block failed the check */
|
||||
if (hash_checked && j==failed_count) {
|
||||
/* recompute all the redundancy information */
|
||||
raid_par(diskmax, state->level, state->block_size, buffer);
|
||||
raid_gen(diskmax, state->level, state->block_size, buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -125,12 +125,12 @@ static int is_hash_matching(struct snapraid_state* state, int rehash, unsigned d
|
|||
static int is_parity_matching(struct snapraid_state* state, unsigned diskmax, unsigned i, void** buffer, void** buffer_recov)
|
||||
{
|
||||
/* recompute parity, note that we don't need parity over i */
|
||||
raid_par(diskmax, i + 1, state->block_size, buffer);
|
||||
raid_gen(diskmax, i + 1, state->block_size, buffer);
|
||||
|
||||
/* if the recovered parity block matches */
|
||||
if (memcmp(buffer[diskmax+i], buffer_recov[i], state->block_size) == 0) {
|
||||
/* recompute all the redundancy information */
|
||||
raid_par(diskmax, state->level, state->block_size, buffer);
|
||||
raid_gen(diskmax, state->level, state->block_size, buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
|
|||
/* no fix required */
|
||||
if (failed_count == 0) {
|
||||
/* recompute only the parity */
|
||||
raid_par(diskmax, state->level, state->block_size, buffer);
|
||||
raid_gen(diskmax, state->level, state->block_size, buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign
|
|||
/* if nothing to fix */
|
||||
if (!something_to_recover) {
|
||||
/* recompute only the parity */
|
||||
raid_par(diskmax, state->level, state->block_size, buffer);
|
||||
raid_gen(diskmax, state->level, state->block_size, buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue