Uses a more general interface for the RAID engine.

This commit is contained in:
Andrea Mazzoleni 2013-12-28 15:12:09 +01:00
parent 684edf2173
commit e80a5e868f
5 changed files with 108 additions and 56 deletions

View file

@ -199,7 +199,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
memcpy(buffer[diskmax+ip[i]], buffer_recov[ip[i]], state->block_size);
/* recover using one less parity, the ip[r-1] one */
raid_rec(r-1, id, ip, diskmax, state->block_size, buffer);
raid_rec_dataonly(r-1, id, ip, diskmax, state->block_size, buffer);
/* use the remaining ip[r-1] parity to check the result */
if (is_parity_matching(state, diskmax, ip[r-1], buffer, buffer_recov))
@ -239,7 +239,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u
memcpy(buffer[diskmax+ip[i]], buffer_recov[ip[i]], state->block_size);
/* recover */
raid_rec(r, id, ip, diskmax, state->block_size, buffer);
raid_rec_dataonly(r, id, ip, diskmax, state->block_size, buffer);
/* use the hash to check the result */
if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero))