Reverses the order of np/nd in raid_par() for consistency with other funcs.

This commit is contained in:
Andrea Mazzoleni 2013-12-28 15:43:00 +01:00
parent e80a5e868f
commit 305b52d32a
6 changed files with 19 additions and 19 deletions

10
check.c
View file

@ -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(state->level, diskmax, state->block_size, buffer);
raid_par(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(i + 1, diskmax, state->block_size, buffer);
raid_par(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(state->level, diskmax, state->block_size, buffer);
raid_par(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(state->level, diskmax, state->block_size, buffer);
raid_par(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(state->level, diskmax, state->block_size, buffer);
raid_par(diskmax, state->level, state->block_size, buffer);
return 0;
}