aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/mktables.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-03-31 00:09:39 -0400
committerNeilBrown <neilb@suse.de>2009-03-31 00:09:39 -0400
commitf701d589aa34d7531183c9ac6f7713ba14212b02 (patch)
treed388cd7fa54c520f12233470a35ebb0676677e7a /drivers/md/mktables.c
parent18b0033491f584a2d79697da714b1ef9d6b27d22 (diff)
md/raid6: move raid6 data processing to raid6_pq.ko
Move the raid6 data processing routines into a standalone module (raid6_pq) to prepare them to be called from async_tx wrappers and other non-md drivers/modules. This precludes a circular dependency of raid456 needing the async modules for data processing while those modules in turn depend on raid456 for the base level synchronous raid6 routines. To support this move: 1/ The exportable definitions in raid6.h move to include/linux/raid/pq.h 2/ The raid6_call, recovery calls, and table symbols are exported 3/ Extra #ifdef __KERNEL__ statements to enable the userspace raid6test to compile Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/mktables.c')
-rw-r--r--drivers/md/mktables.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/md/mktables.c b/drivers/md/mktables.c
index b61d5767aae7..3b1500843bba 100644
--- a/drivers/md/mktables.c
+++ b/drivers/md/mktables.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
59 uint8_t v; 59 uint8_t v;
60 uint8_t exptbl[256], invtbl[256]; 60 uint8_t exptbl[256], invtbl[256];
61 61
62 printf("#include \"raid6.h\"\n"); 62 printf("#include <linux/raid/pq.h>\n");
63 63
64 /* Compute multiplication table */ 64 /* Compute multiplication table */
65 printf("\nconst u8 __attribute__((aligned(256)))\n" 65 printf("\nconst u8 __attribute__((aligned(256)))\n"
@@ -76,6 +76,9 @@ int main(int argc, char *argv[])
76 printf("\t},\n"); 76 printf("\t},\n");
77 } 77 }
78 printf("};\n"); 78 printf("};\n");
79 printf("#ifdef __KERNEL__\n");
80 printf("EXPORT_SYMBOL(raid6_gfmul);\n");
81 printf("#endif\n");
79 82
80 /* Compute power-of-2 table (exponent) */ 83 /* Compute power-of-2 table (exponent) */
81 v = 1; 84 v = 1;
@@ -92,6 +95,9 @@ int main(int argc, char *argv[])
92 } 95 }
93 } 96 }
94 printf("};\n"); 97 printf("};\n");
98 printf("#ifdef __KERNEL__\n");
99 printf("EXPORT_SYMBOL(raid6_gfexp);\n");
100 printf("#endif\n");
95 101
96 /* Compute inverse table x^-1 == x^254 */ 102 /* Compute inverse table x^-1 == x^254 */
97 printf("\nconst u8 __attribute__((aligned(256)))\n" 103 printf("\nconst u8 __attribute__((aligned(256)))\n"
@@ -104,6 +110,9 @@ int main(int argc, char *argv[])
104 } 110 }
105 } 111 }
106 printf("};\n"); 112 printf("};\n");
113 printf("#ifdef __KERNEL__\n");
114 printf("EXPORT_SYMBOL(raid6_gfinv);\n");
115 printf("#endif\n");
107 116
108 /* Compute inv(2^x + 1) (exponent-xor-inverse) table */ 117 /* Compute inv(2^x + 1) (exponent-xor-inverse) table */
109 printf("\nconst u8 __attribute__((aligned(256)))\n" 118 printf("\nconst u8 __attribute__((aligned(256)))\n"
@@ -115,6 +124,9 @@ int main(int argc, char *argv[])
115 (j == 7) ? '\n' : ' '); 124 (j == 7) ? '\n' : ' ');
116 } 125 }
117 printf("};\n"); 126 printf("};\n");
127 printf("#ifdef __KERNEL__\n");
128 printf("EXPORT_SYMBOL(raid6_gfexi);\n");
129 printf("#endif\n");
118 130
119 return 0; 131 return 0;
120} 132}