From b81e4a0141ded74506972f5a4703954bfba92d95 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 26 Dec 2013 09:45:51 +0100 Subject: [PATCH] Renames some variables. No functional change. --- check.c | 36 ++-- raid.c | 488 ++++++++++++++++++++++++++--------------------------- raid.h | 78 ++++----- selftest.c | 96 +++++------ speed.c | 126 +++++++------- 5 files changed, 412 insertions(+), 412 deletions(-) diff --git a/check.c b/check.c index a9277c0a..6a4f36a2 100644 --- a/check.c +++ b/check.c @@ -147,8 +147,8 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u unsigned i, n; int error; int has_hash; - int d[LEV_MAX]; - int p[LEV_MAX]; + int id[LEV_MAX]; + int ip[LEV_MAX]; /* no fix required */ if (failed_count == 0) { @@ -167,7 +167,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u /* setup vector of failed disk indexes */ for(i=0;iblock_size); + memcpy(buffer[diskmax+ip[i]], buffer_recov[ip[i]], state->block_size); - /* recover using one less parity, the p[r-1] one */ - raid_rec(r-1, d, p, diskmax, state->block_size, buffer, buffer_zero); + /* recover using one less parity, the ip[r-1] one */ + raid_rec(r-1, id, ip, diskmax, state->block_size, buffer, buffer_zero); - /* use the remaining p[r-1] parity to check the result */ - if (is_parity_matching(state, diskmax, p[r-1], buffer, buffer_recov)) + /* use the remaining ip[r-1] parity to check the result */ + if (is_parity_matching(state, diskmax, ip[r-1], buffer, buffer_recov)) return 0; /* log */ @@ -210,11 +210,11 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u for(i=0;iblock_size); + memcpy(buffer[diskmax+ip[i]], buffer_recov[ip[i]], state->block_size); /* recover */ - raid_rec(r, d, p, diskmax, state->block_size, buffer, buffer_zero); + raid_rec(r, id, ip, diskmax, state->block_size, buffer, buffer_zero); /* use the hash to check the result */ if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero)) @@ -250,11 +250,11 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u for(i=0;i 0 && nrec <= RAID_PARITY_CAUCHY_MAX); + assert(nr > 0 && nr <= RAID_PARITY_CAUCHY_MAX); - for(i=0;i