From 2456e88132da9cfc89fcfb5d5fafc670d9045ddc Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 26 Oct 2013 19:06:47 +0200 Subject: [PATCH] Reviews again raid comments. --- raid.c | 180 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/raid.c b/raid.c index a171f70f..64687dc3 100644 --- a/raid.c +++ b/raid.c @@ -16,57 +16,57 @@ */ /* - * The RAID5/RAID6 support was originally derived from the libraid6 library + * The RAID5 and RAID6 support were originally derived from the libraid6 library * by H. Peter Anvin released with license "GPL2 or any later version" * used in the Linux Kernel 2.6.38. * This support was later completely rewritten (many times), but the * H. Peter Anvin's Copyright may still apply. * - * The RAIDTP/RAIDQP/RAIDPP/RAIDHP support is original work implemented - * from scratch. + * The RAIDTP (Triple Parity), RAIDQP (Quad parity), RAIDPP (Penta Parity) and + * RAIDHP (Hexa parity) support is original work implemented from scratch. * - * The RAID5 and RAID6 support works like the one implemented in the Linux - * Kernel RAID and it's based on the Anvin's paper "The mathematics of RAID-6" [1]. + * For RAID5 and RAID6 it works like the Linux Kernel RAID and it's based on + * the Anvin's paper "The mathematics of RAID-6" [1]. * * We compute the parity in the Galois Field GF(2^8) with the primitive * polynomial x^8 + x^4 + x^3 + x^2 + 1 (285 decimal), starting from a set - * of n disk Di with 0<=i=0;--d) { - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.poly[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0])); asm volatile("movdqa %0,%%xmm4" : : "m" (vbuf[d][i])); asm volatile("pxor %xmm5,%xmm5"); @@ -807,7 +807,7 @@ void raidQP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) asm volatile("pand %xmm7,%xmm5"); asm volatile("pxor %xmm5,%xmm1"); - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.mask[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.mask[0])); asm volatile("pxor %xmm4,%xmm0"); asm volatile("pxor %xmm4,%xmm1"); @@ -872,8 +872,8 @@ void raidQP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) asm volatile("pxor %xmm10,%xmm10"); asm volatile("pxor %xmm11,%xmm11"); for(d=l;d>=0;--d) { - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.poly[0])); - asm volatile("movdqa %0,%%xmm15" : : "m" (raid_16_const.mask[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0])); + asm volatile("movdqa %0,%%xmm15" : : "m" (gfconst16.mask[0])); asm volatile("movdqa %0,%%xmm4" : : "m" (vbuf[d][i])); asm volatile("movdqa %0,%%xmm12" : : "m" (vbuf[d][i+16])); @@ -1023,7 +1023,7 @@ void raidPP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) for(d=l;d>=0;--d) { asm volatile("movdqa %0,%%xmm4" : : "m" (vbuf[d][i])); asm volatile("movdqa %0,%%xmm6" : : "m" (p0[0])); - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.poly[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0])); asm volatile("pxor %xmm5,%xmm5"); asm volatile("pcmpgtb %xmm0,%xmm5"); @@ -1035,7 +1035,7 @@ void raidPP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) asm volatile("pxor %xmm4,%xmm6"); asm volatile("movdqa %%xmm6,%0" : "=m" (p0)); - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.mask[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.mask[0])); asm volatile("movdqa %xmm4,%xmm5"); asm volatile("psraw $4,%xmm5"); asm volatile("pand %xmm7,%xmm4"); @@ -1097,8 +1097,8 @@ void raidPP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) s = vbuf[data+3]; t = vbuf[data+4]; - asm volatile("movdqa %0,%%xmm14" : : "m" (raid_16_const.poly[0])); - asm volatile("movdqa %0,%%xmm15" : : "m" (raid_16_const.mask[0])); + asm volatile("movdqa %0,%%xmm14" : : "m" (gfconst16.poly[0])); + asm volatile("movdqa %0,%%xmm15" : : "m" (gfconst16.mask[0])); for(i=0;i=0;--d) { asm volatile("movdqa %0,%%xmm5" : : "m" (p0[0])); asm volatile("movdqa %0,%%xmm6" : : "m" (q0[0])); - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.poly[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.poly[0])); asm volatile("pxor %xmm4,%xmm4"); asm volatile("pcmpgtb %xmm6,%xmm4"); @@ -1258,7 +1258,7 @@ void raidHP_ssse3(unsigned char** vbuf, unsigned data, unsigned size) asm volatile("movdqa %%xmm5,%0" : "=m" (p0)); asm volatile("movdqa %%xmm6,%0" : "=m" (q0)); - asm volatile("movdqa %0,%%xmm7" : : "m" (raid_16_const.mask[0])); + asm volatile("movdqa %0,%%xmm7" : : "m" (gfconst16.mask[0])); asm volatile("movdqa %xmm4,%xmm5"); asm volatile("psraw $4,%xmm5"); asm volatile("pand %xmm7,%xmm4"); @@ -1331,8 +1331,8 @@ void raidHP_ssse3ext(unsigned char** vbuf, unsigned data, unsigned size) t = vbuf[data+4]; u = vbuf[data+5]; - asm volatile("movdqa %0,%%xmm14" : : "m" (raid_16_const.poly[0])); - asm volatile("movdqa %0,%%xmm15" : : "m" (raid_16_const.mask[0])); + asm volatile("movdqa %0,%%xmm14" : : "m" (gfconst16.poly[0])); + asm volatile("movdqa %0,%%xmm15" : : "m" (gfconst16.mask[0])); for(i=0;i