From bfa35bc511b79f58d561737bbf17339813840404 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 2 Nov 2013 16:15:31 +0100 Subject: [PATCH] Removes unnecessary unrolling in raid delta functions. --- raid.c | 324 +++++++-------------------------------------------------- 1 file changed, 37 insertions(+), 287 deletions(-) diff --git a/raid.c b/raid.c index fc8b66f8..84bd8ea5 100644 --- a/raid.c +++ b/raid.c @@ -1874,295 +1874,45 @@ static inline const unsigned char* table(unsigned char v) /** * Computes the parity without the missing data blocks * and store it in the buffers of such data blocks. + * + * This is the parity expressed as Pa,Qa,Ra,Sa,Ta,Ua + * in the equations. + * + * Note that all the other parities not in the e[] vector + * are destroyed. */ -static void raid_delta_1data(const int* d, const int* e, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size) +static void raid_delta_gen(unsigned level, const int* d, const int* e, unsigned char** vbuf, unsigned data, unsigned char* zero, unsigned size) { - unsigned char* p; - unsigned char* pa; + unsigned char* p[6]; + unsigned char* pa[6]; + unsigned i; - /* parity buffer */ - p = vbuf[data+e[0]]; + assert(level > 0 && level <= 6); - /* missing data blcks */ - pa = vbuf[d[0]]; + for(i=0;i