aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid6algos.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/raid6algos.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/raid6algos.c')
-rw-r--r--drivers/md/raid6algos.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c
index 1f6a3c82ee0c..866215ac7f25 100644
--- a/drivers/md/raid6algos.c
+++ b/drivers/md/raid6algos.c
@@ -16,13 +16,20 @@
16 * Algorithm list and algorithm selection for RAID-6 16 * Algorithm list and algorithm selection for RAID-6
17 */ 17 */
18 18
19#include "raid6.h" 19#include <linux/raid/pq.h>
20#ifndef __KERNEL__ 20#ifndef __KERNEL__
21#include <sys/mman.h> 21#include <sys/mman.h>
22#include <stdio.h> 22#include <stdio.h>
23#else
24#if !RAID6_USE_EMPTY_ZERO_PAGE
25/* In .bss so it's zeroed */
26const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
27EXPORT_SYMBOL(raid6_empty_zero_page);
28#endif
23#endif 29#endif
24 30
25struct raid6_calls raid6_call; 31struct raid6_calls raid6_call;
32EXPORT_SYMBOL_GPL(raid6_call);
26 33
27/* Various routine sets */ 34/* Various routine sets */
28extern const struct raid6_calls raid6_intx1; 35extern const struct raid6_calls raid6_intx1;
@@ -79,6 +86,7 @@ const struct raid6_calls * const raid6_algos[] = {
79#else 86#else
80/* Need more time to be stable in userspace */ 87/* Need more time to be stable in userspace */
81#define RAID6_TIME_JIFFIES_LG2 9 88#define RAID6_TIME_JIFFIES_LG2 9
89#define time_before(x, y) ((x) < (y))
82#endif 90#endif
83 91
84/* Try to pick the best algorithm */ 92/* Try to pick the best algorithm */
@@ -152,3 +160,12 @@ int __init raid6_select_algo(void)
152 160
153 return best ? 0 : -EINVAL; 161 return best ? 0 : -EINVAL;
154} 162}
163
164static void raid6_exit(void)
165{
166 do { } while (0);
167}
168
169subsys_initcall(raid6_select_algo);
170module_exit(raid6_exit);
171MODULE_LICENSE("GPL");