aboutsummaryrefslogtreecommitdiffstats
path: root/lib/raid6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/raid6')
-rw-r--r--lib/raid6/Makefile81
-rw-r--r--lib/raid6/algos.c (renamed from lib/raid6/raid6algos.c)4
-rw-r--r--lib/raid6/altivec.uc (renamed from lib/raid6/raid6altivec.uc)0
-rw-r--r--lib/raid6/int.uc (renamed from lib/raid6/raid6int.uc)0
-rw-r--r--lib/raid6/mmx.c (renamed from lib/raid6/raid6mmx.c)6
-rw-r--r--lib/raid6/raid6test/Makefile75
-rw-r--r--lib/raid6/recov.c (renamed from lib/raid6/raid6recov.c)2
-rw-r--r--lib/raid6/sse1.c (renamed from lib/raid6/raid6sse1.c)6
-rw-r--r--lib/raid6/sse2.c (renamed from lib/raid6/raid6sse2.c)4
-rw-r--r--lib/raid6/test/Makefile72
-rw-r--r--lib/raid6/test/test.c (renamed from lib/raid6/raid6test/test.c)0
-rw-r--r--lib/raid6/x86.h (renamed from lib/raid6/raid6x86.h)2
12 files changed, 123 insertions, 129 deletions
diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
index 19bf32da644f..8a38102770f3 100644
--- a/lib/raid6/Makefile
+++ b/lib/raid6/Makefile
@@ -1,11 +1,8 @@
1obj-$(CONFIG_RAID6_PQ) += raid6_pq.o 1obj-$(CONFIG_RAID6_PQ) += raid6_pq.o
2 2
3raid6_pq-y += raid6algos.o raid6recov.o raid6tables.o \ 3raid6_pq-y += algos.o recov.o tables.o int1.o int2.o int4.o \
4 raid6int1.o raid6int2.o raid6int4.o \ 4 int8.o int16.o int32.o altivec1.o altivec2.o altivec4.o \
5 raid6int8.o raid6int16.o raid6int32.o \ 5 altivec8.o mmx.o sse1.o sse2.o
6 raid6altivec1.o raid6altivec2.o raid6altivec4.o \
7 raid6altivec8.o \
8 raid6mmx.o raid6sse1.o raid6sse2.o
9hostprogs-y += mktables 6hostprogs-y += mktables
10 7
11quiet_cmd_unroll = UNROLL $@ 8quiet_cmd_unroll = UNROLL $@
@@ -16,63 +13,63 @@ ifeq ($(CONFIG_ALTIVEC),y)
16altivec_flags := -maltivec -mabi=altivec 13altivec_flags := -maltivec -mabi=altivec
17endif 14endif
18 15
19targets += raid6int1.c 16targets += int1.c
20$(obj)/raid6int1.c: UNROLL := 1 17$(obj)/int1.c: UNROLL := 1
21$(obj)/raid6int1.c: $(src)/raid6int.uc $(src)/unroll.awk FORCE 18$(obj)/int1.c: $(src)/int.uc $(src)/unroll.awk FORCE
22 $(call if_changed,unroll) 19 $(call if_changed,unroll)
23 20
24targets += raid6int2.c 21targets += int2.c
25$(obj)/raid6int2.c: UNROLL := 2 22$(obj)/int2.c: UNROLL := 2
26$(obj)/raid6int2.c: $(src)/raid6int.uc $(src)/unroll.awk FORCE 23$(obj)/int2.c: $(src)/int.uc $(src)/unroll.awk FORCE
27 $(call if_changed,unroll) 24 $(call if_changed,unroll)
28 25
29targets += raid6int4.c 26targets += int4.c
30$(obj)/raid6int4.c: UNROLL := 4 27$(obj)/int4.c: UNROLL := 4
31$(obj)/raid6int4.c: $(src)/raid6int.uc $(src)/unroll.awk FORCE 28$(obj)/int4.c: $(src)/int.uc $(src)/unroll.awk FORCE
32 $(call if_changed,unroll) 29 $(call if_changed,unroll)
33 30
34targets += raid6int8.c 31targets += int8.c
35$(obj)/raid6int8.c: UNROLL := 8 32$(obj)/int8.c: UNROLL := 8
36$(obj)/raid6int8.c: $(src)/raid6int.uc $(src)/unroll.awk FORCE 33$(obj)/int8.c: $(src)/int.uc $(src)/unroll.awk FORCE
37 $(call if_changed,unroll) 34 $(call if_changed,unroll)
38 35
39targets += raid6int16.c 36targets += int16.c
40$(obj)/raid6int16.c: UNROLL := 16 37$(obj)/int16.c: UNROLL := 16
41$(obj)/raid6int16.c: $(src)/raid6int.uc $(src)/unroll.awk FORCE 38$(obj)/int16.c: $(src)/int.uc $(src)/unroll.awk FORCE
42 $(call if_changed,unroll) 39 $(call if_changed,unroll)
43 40
44targets += raid6int32.c 41targets += int32.c
45$(obj)/raid6int32.c: UNROLL := 32 42$(obj)/int32.c: UNROLL := 32
46$(obj)/raid6int32.c: $(src)/raid6int.uc $(src)/unroll.awk FORCE 43$(obj)/int32.c: $(src)/int.uc $(src)/unroll.awk FORCE
47 $(call if_changed,unroll) 44 $(call if_changed,unroll)
48 45
49CFLAGS_raid6altivec1.o += $(altivec_flags) 46CFLAGS_altivec1.o += $(altivec_flags)
50targets += raid6altivec1.c 47targets += altivec1.c
51$(obj)/raid6altivec1.c: UNROLL := 1 48$(obj)/altivec1.c: UNROLL := 1
52$(obj)/raid6altivec1.c: $(src)/raid6altivec.uc $(src)/unroll.awk FORCE 49$(obj)/altivec1.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
53 $(call if_changed,unroll) 50 $(call if_changed,unroll)
54 51
55CFLAGS_raid6altivec2.o += $(altivec_flags) 52CFLAGS_altivec2.o += $(altivec_flags)
56targets += raid6altivec2.c 53targets += altivec2.c
57$(obj)/raid6altivec2.c: UNROLL := 2 54$(obj)/altivec2.c: UNROLL := 2
58$(obj)/raid6altivec2.c: $(src)/raid6altivec.uc $(src)/unroll.awk FORCE 55$(obj)/altivec2.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
59 $(call if_changed,unroll) 56 $(call if_changed,unroll)
60 57
61CFLAGS_raid6altivec4.o += $(altivec_flags) 58CFLAGS_altivec4.o += $(altivec_flags)
62targets += raid6altivec4.c 59targets += altivec4.c
63$(obj)/raid6altivec4.c: UNROLL := 4 60$(obj)/altivec4.c: UNROLL := 4
64$(obj)/raid6altivec4.c: $(src)/raid6altivec.uc $(src)/unroll.awk FORCE 61$(obj)/altivec4.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
65 $(call if_changed,unroll) 62 $(call if_changed,unroll)
66 63
67CFLAGS_raid6altivec8.o += $(altivec_flags) 64CFLAGS_altivec8.o += $(altivec_flags)
68targets += raid6altivec8.c 65targets += altivec8.c
69$(obj)/raid6altivec8.c: UNROLL := 8 66$(obj)/altivec8.c: UNROLL := 8
70$(obj)/raid6altivec8.c: $(src)/raid6altivec.uc $(src)/unroll.awk FORCE 67$(obj)/altivec8.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
71 $(call if_changed,unroll) 68 $(call if_changed,unroll)
72 69
73quiet_cmd_mktable = TABLE $@ 70quiet_cmd_mktable = TABLE $@
74 cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 ) 71 cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
75 72
76targets += raid6tables.c 73targets += tables.c
77$(obj)/raid6tables.c: $(obj)/mktables FORCE 74$(obj)/tables.c: $(obj)/mktables FORCE
78 $(call if_changed,mktable) 75 $(call if_changed,mktable)
diff --git a/lib/raid6/raid6algos.c b/lib/raid6/algos.c
index 1f8784bfd44d..b595f560bee7 100644
--- a/lib/raid6/raid6algos.c
+++ b/lib/raid6/algos.c
@@ -11,17 +11,17 @@
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13/* 13/*
14 * raid6algos.c 14 * raid6/algos.c
15 * 15 *
16 * Algorithm list and algorithm selection for RAID-6 16 * Algorithm list and algorithm selection for RAID-6
17 */ 17 */
18 18
19#include <linux/raid/pq.h> 19#include <linux/raid/pq.h>
20#include <linux/gfp.h>
21#ifndef __KERNEL__ 20#ifndef __KERNEL__
22#include <sys/mman.h> 21#include <sys/mman.h>
23#include <stdio.h> 22#include <stdio.h>
24#else 23#else
24#include <linux/gfp.h>
25#if !RAID6_USE_EMPTY_ZERO_PAGE 25#if !RAID6_USE_EMPTY_ZERO_PAGE
26/* In .bss so it's zeroed */ 26/* In .bss so it's zeroed */
27const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256))); 27const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
diff --git a/lib/raid6/raid6altivec.uc b/lib/raid6/altivec.uc
index 2654d5c854be..2654d5c854be 100644
--- a/lib/raid6/raid6altivec.uc
+++ b/lib/raid6/altivec.uc
diff --git a/lib/raid6/raid6int.uc b/lib/raid6/int.uc
index d1e276a14fab..d1e276a14fab 100644
--- a/lib/raid6/raid6int.uc
+++ b/lib/raid6/int.uc
diff --git a/lib/raid6/raid6mmx.c b/lib/raid6/mmx.c
index e7f6c13132bf..279347f23094 100644
--- a/lib/raid6/raid6mmx.c
+++ b/lib/raid6/mmx.c
@@ -11,7 +11,7 @@
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13/* 13/*
14 * raid6mmx.c 14 * raid6/mmx.c
15 * 15 *
16 * MMX implementation of RAID-6 syndrome functions 16 * MMX implementation of RAID-6 syndrome functions
17 */ 17 */
@@ -19,9 +19,9 @@
19#if defined(__i386__) && !defined(__arch_um__) 19#if defined(__i386__) && !defined(__arch_um__)
20 20
21#include <linux/raid/pq.h> 21#include <linux/raid/pq.h>
22#include "raid6x86.h" 22#include "x86.h"
23 23
24/* Shared with raid6sse1.c */ 24/* Shared with raid6/sse1.c */
25const struct raid6_mmx_constants { 25const struct raid6_mmx_constants {
26 u64 x1d; 26 u64 x1d;
27} raid6_mmx_constants = { 27} raid6_mmx_constants = {
diff --git a/lib/raid6/raid6test/Makefile b/lib/raid6/raid6test/Makefile
deleted file mode 100644
index 2874cbef529d..000000000000
--- a/lib/raid6/raid6test/Makefile
+++ /dev/null
@@ -1,75 +0,0 @@
1#
2# This is a simple Makefile to test some of the RAID-6 code
3# from userspace.
4#
5
6CC = gcc
7OPTFLAGS = -O2 # Adjust as desired
8CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS)
9LD = ld
10AWK = awk
11AR = ar
12RANLIB = ranlib
13
14.c.o:
15 $(CC) $(CFLAGS) -c -o $@ $<
16
17%.c: ../%.c
18 cp -f $< $@
19
20%.uc: ../%.uc
21 cp -f $< $@
22
23all: raid6.a raid6test
24
25raid6.a: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \
26 raid6int32.o \
27 raid6mmx.o raid6sse1.o raid6sse2.o \
28 raid6altivec1.o raid6altivec2.o raid6altivec4.o raid6altivec8.o \
29 raid6recov.o raid6algos.o \
30 raid6tables.o
31 rm -f $@
32 $(AR) cq $@ $^
33 $(RANLIB) $@
34
35raid6test: test.c raid6.a
36 $(CC) $(CFLAGS) -o raid6test $^
37
38raid6altivec1.c: raid6altivec.uc ../unroll.awk
39 $(AWK) ../unroll.awk -vN=1 < raid6altivec.uc > $@
40
41raid6altivec2.c: raid6altivec.uc ../unroll.awk
42 $(AWK) ../unroll.awk -vN=2 < raid6altivec.uc > $@
43
44raid6altivec4.c: raid6altivec.uc ../unroll.awk
45 $(AWK) ../unroll.awk -vN=4 < raid6altivec.uc > $@
46
47raid6altivec8.c: raid6altivec.uc ../unroll.awk
48 $(AWK) ../unroll.awk -vN=8 < raid6altivec.uc > $@
49
50raid6int1.c: raid6int.uc ../unroll.awk
51 $(AWK) ../unroll.awk -vN=1 < raid6int.uc > $@
52
53raid6int2.c: raid6int.uc ../unroll.awk
54 $(AWK) ../unroll.awk -vN=2 < raid6int.uc > $@
55
56raid6int4.c: raid6int.uc ../unroll.awk
57 $(AWK) ../unroll.awk -vN=4 < raid6int.uc > $@
58
59raid6int8.c: raid6int.uc ../unroll.awk
60 $(AWK) ../unroll.awk -vN=8 < raid6int.uc > $@
61
62raid6int16.c: raid6int.uc ../unroll.awk
63 $(AWK) ../unroll.awk -vN=16 < raid6int.uc > $@
64
65raid6int32.c: raid6int.uc ../unroll.awk
66 $(AWK) ../unroll.awk -vN=32 < raid6int.uc > $@
67
68raid6tables.c: mktables
69 ./mktables > raid6tables.c
70
71clean:
72 rm -f *.o *.a mktables mktables.c raid6int.uc raid6*.c raid6test
73
74spotless: clean
75 rm -f *~
diff --git a/lib/raid6/raid6recov.c b/lib/raid6/recov.c
index 2609f00e0d61..8590d19cf522 100644
--- a/lib/raid6/raid6recov.c
+++ b/lib/raid6/recov.c
@@ -11,7 +11,7 @@
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13/* 13/*
14 * raid6recov.c 14 * raid6/recov.c
15 * 15 *
16 * RAID-6 data recovery in dual failure mode. In single failure mode, 16 * RAID-6 data recovery in dual failure mode. In single failure mode,
17 * use the RAID-5 algorithm (or, in the case of Q failure, just reconstruct 17 * use the RAID-5 algorithm (or, in the case of Q failure, just reconstruct
diff --git a/lib/raid6/raid6sse1.c b/lib/raid6/sse1.c
index b274dd5eab8f..10dd91948c07 100644
--- a/lib/raid6/raid6sse1.c
+++ b/lib/raid6/sse1.c
@@ -11,7 +11,7 @@
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13/* 13/*
14 * raid6sse1.c 14 * raid6/sse1.c
15 * 15 *
16 * SSE-1/MMXEXT implementation of RAID-6 syndrome functions 16 * SSE-1/MMXEXT implementation of RAID-6 syndrome functions
17 * 17 *
@@ -24,9 +24,9 @@
24#if defined(__i386__) && !defined(__arch_um__) 24#if defined(__i386__) && !defined(__arch_um__)
25 25
26#include <linux/raid/pq.h> 26#include <linux/raid/pq.h>
27#include "raid6x86.h" 27#include "x86.h"
28 28
29/* Defined in raid6mmx.c */ 29/* Defined in raid6/mmx.c */
30extern const struct raid6_mmx_constants { 30extern const struct raid6_mmx_constants {
31 u64 x1d; 31 u64 x1d;
32} raid6_mmx_constants; 32} raid6_mmx_constants;
diff --git a/lib/raid6/raid6sse2.c b/lib/raid6/sse2.c
index 6ed6c6c0389f..bc2d57daa589 100644
--- a/lib/raid6/raid6sse2.c
+++ b/lib/raid6/sse2.c
@@ -11,7 +11,7 @@
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13/* 13/*
14 * raid6sse2.c 14 * raid6/sse2.c
15 * 15 *
16 * SSE-2 implementation of RAID-6 syndrome functions 16 * SSE-2 implementation of RAID-6 syndrome functions
17 * 17 *
@@ -20,7 +20,7 @@
20#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__) 20#if (defined(__i386__) || defined(__x86_64__)) && !defined(__arch_um__)
21 21
22#include <linux/raid/pq.h> 22#include <linux/raid/pq.h>
23#include "raid6x86.h" 23#include "x86.h"
24 24
25static const struct raid6_sse_constants { 25static const struct raid6_sse_constants {
26 u64 x1d[2]; 26 u64 x1d[2];
diff --git a/lib/raid6/test/Makefile b/lib/raid6/test/Makefile
new file mode 100644
index 000000000000..aa651697b6dc
--- /dev/null
+++ b/lib/raid6/test/Makefile
@@ -0,0 +1,72 @@
1#
2# This is a simple Makefile to test some of the RAID-6 code
3# from userspace.
4#
5
6CC = gcc
7OPTFLAGS = -O2 # Adjust as desired
8CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS)
9LD = ld
10AWK = awk -f
11AR = ar
12RANLIB = ranlib
13
14.c.o:
15 $(CC) $(CFLAGS) -c -o $@ $<
16
17%.c: ../%.c
18 cp -f $< $@
19
20%.uc: ../%.uc
21 cp -f $< $@
22
23all: raid6.a raid6test
24
25raid6.a: int1.o int2.o int4.o int8.o int16.o int32.o mmx.o sse1.o sse2.o \
26 altivec1.o altivec2.o altivec4.o altivec8.o recov.o algos.o \
27 tables.o
28 rm -f $@
29 $(AR) cq $@ $^
30 $(RANLIB) $@
31
32raid6test: test.c raid6.a
33 $(CC) $(CFLAGS) -o raid6test $^
34
35altivec1.c: altivec.uc ../unroll.awk
36 $(AWK) ../unroll.awk -vN=1 < altivec.uc > $@
37
38altivec2.c: altivec.uc ../unroll.awk
39 $(AWK) ../unroll.awk -vN=2 < altivec.uc > $@
40
41altivec4.c: altivec.uc ../unroll.awk
42 $(AWK) ../unroll.awk -vN=4 < altivec.uc > $@
43
44altivec8.c: altivec.uc ../unroll.awk
45 $(AWK) ../unroll.awk -vN=8 < altivec.uc > $@
46
47int1.c: int.uc ../unroll.awk
48 $(AWK) ../unroll.awk -vN=1 < int.uc > $@
49
50int2.c: int.uc ../unroll.awk
51 $(AWK) ../unroll.awk -vN=2 < int.uc > $@
52
53int4.c: int.uc ../unroll.awk
54 $(AWK) ../unroll.awk -vN=4 < int.uc > $@
55
56int8.c: int.uc ../unroll.awk
57 $(AWK) ../unroll.awk -vN=8 < int.uc > $@
58
59int16.c: int.uc ../unroll.awk
60 $(AWK) ../unroll.awk -vN=16 < int.uc > $@
61
62int32.c: int.uc ../unroll.awk
63 $(AWK) ../unroll.awk -vN=32 < int.uc > $@
64
65tables.c: mktables
66 ./mktables > tables.c
67
68clean:
69 rm -f *.o *.a mktables mktables.c *.uc int*.c altivec*.c tables.c raid6test
70
71spotless: clean
72 rm -f *~
diff --git a/lib/raid6/raid6test/test.c b/lib/raid6/test/test.c
index 7a930318b17d..7a930318b17d 100644
--- a/lib/raid6/raid6test/test.c
+++ b/lib/raid6/test/test.c
diff --git a/lib/raid6/raid6x86.h b/lib/raid6/x86.h
index 4c22c1568558..cb2a8c91c886 100644
--- a/lib/raid6/raid6x86.h
+++ b/lib/raid6/x86.h
@@ -11,7 +11,7 @@
11 * ----------------------------------------------------------------------- */ 11 * ----------------------------------------------------------------------- */
12 12
13/* 13/*
14 * raid6x86.h 14 * raid6/x86.h
15 * 15 *
16 * Definitions common to x86 and x86-64 RAID-6 code only 16 * Definitions common to x86 and x86-64 RAID-6 code only
17 */ 17 */