diff options
author | Dan Williams <dan.j.williams@intel.com> | 2007-07-09 14:56:42 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2007-07-13 11:06:14 -0400 |
commit | 685784aaf3cd0e3ff5e36c7ecf6f441cdbf57f73 (patch) | |
tree | 10f99829f7d877b87614fe69be77e363c026a8d7 /drivers/md/raid5.c | |
parent | d379b01e9087a582d58f4b678208a4f8d8376fe7 (diff) |
xor: make 'xor_blocks' a library routine for use with async_tx
The async_tx api tries to use a dma engine for an operation, but will fall
back to an optimized software routine otherwise. Xor support is
implemented using the raid5 xor routines. For organizational purposes this
routine is moved to a common area.
The following fixes are also made:
* rename xor_block => xor_blocks, suggested by Adrian Bunk
* ensure that xor.o initializes before md.o in the built-in case
* checkpatch.pl fixes
* mark calibrate_xor_blocks __init, Adrian Bunk
Cc: Adrian Bunk <bunk@stusta.de>
Cc: NeilBrown <neilb@suse.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 061375ee6592..5adbe0b22684 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -918,7 +918,7 @@ static void copy_data(int frombio, struct bio *bio, | |||
918 | 918 | ||
919 | #define check_xor() do { \ | 919 | #define check_xor() do { \ |
920 | if (count == MAX_XOR_BLOCKS) { \ | 920 | if (count == MAX_XOR_BLOCKS) { \ |
921 | xor_block(count, STRIPE_SIZE, ptr); \ | 921 | xor_blocks(count, STRIPE_SIZE, ptr); \ |
922 | count = 1; \ | 922 | count = 1; \ |
923 | } \ | 923 | } \ |
924 | } while(0) | 924 | } while(0) |
@@ -949,7 +949,7 @@ static void compute_block(struct stripe_head *sh, int dd_idx) | |||
949 | check_xor(); | 949 | check_xor(); |
950 | } | 950 | } |
951 | if (count != 1) | 951 | if (count != 1) |
952 | xor_block(count, STRIPE_SIZE, ptr); | 952 | xor_blocks(count, STRIPE_SIZE, ptr); |
953 | set_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); | 953 | set_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); |
954 | } | 954 | } |
955 | 955 | ||
@@ -1004,7 +1004,7 @@ static void compute_parity5(struct stripe_head *sh, int method) | |||
1004 | break; | 1004 | break; |
1005 | } | 1005 | } |
1006 | if (count>1) { | 1006 | if (count>1) { |
1007 | xor_block(count, STRIPE_SIZE, ptr); | 1007 | xor_blocks(count, STRIPE_SIZE, ptr); |
1008 | count = 1; | 1008 | count = 1; |
1009 | } | 1009 | } |
1010 | 1010 | ||
@@ -1038,7 +1038,7 @@ static void compute_parity5(struct stripe_head *sh, int method) | |||
1038 | } | 1038 | } |
1039 | } | 1039 | } |
1040 | if (count != 1) | 1040 | if (count != 1) |
1041 | xor_block(count, STRIPE_SIZE, ptr); | 1041 | xor_blocks(count, STRIPE_SIZE, ptr); |
1042 | 1042 | ||
1043 | if (method != CHECK_PARITY) { | 1043 | if (method != CHECK_PARITY) { |
1044 | set_bit(R5_UPTODATE, &sh->dev[pd_idx].flags); | 1044 | set_bit(R5_UPTODATE, &sh->dev[pd_idx].flags); |
@@ -1160,7 +1160,7 @@ static void compute_block_1(struct stripe_head *sh, int dd_idx, int nozero) | |||
1160 | check_xor(); | 1160 | check_xor(); |
1161 | } | 1161 | } |
1162 | if (count != 1) | 1162 | if (count != 1) |
1163 | xor_block(count, STRIPE_SIZE, ptr); | 1163 | xor_blocks(count, STRIPE_SIZE, ptr); |
1164 | if (!nozero) set_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); | 1164 | if (!nozero) set_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); |
1165 | else clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); | 1165 | else clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); |
1166 | } | 1166 | } |