diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2014-05-22 15:48:15 +0400 |
---|---|---|
committer | Boaz Harrosh <bharrosh@panasas.com> | 2014-05-22 15:48:15 +0400 |
commit | ce5d36aac26cc395fe3bc45525cdbad3644f01e5 (patch) | |
tree | 04aa541850b8282baf000657307c6504d16c52ab /fs/exofs/ore_raid.h | |
parent | 455682ce547817d75e38028283dc8db00754005d (diff) | |
download | linux-ce5d36aac26cc395fe3bc45525cdbad3644f01e5.tar.xz |
ore: Support for raid 6
This simple patch adds support for raid6 to the ORE.
Most operations and calculations where already for the general
case. Only things left:
* call async_gen_syndrome() in the case of raid6
(NOTE that the raid6 math is the one supported by the Linux Kernel
see: crypto/async_tx/async_pq.c)
* call _ore_add_parity_unit() twice with only last call generating
the redundancy pages.
* Fix couple BUGS in old code
a. In reads when parity==2 it can happen that per_dev->length=0
but per_dev->offset was set and adjusted by _ore_add_sg_seg().
Don't let it be overwritten.
b. The all 'cur_comp > starting_dev' thing to determine if:
"per_dev->offset is in the current stripe number or the
next one."
Was a complete raid5/4 accident. When parity==2 this is not
at all true usually. All we need to do is increment si->ob_offset
once we pass by the first parity device.
(This also greatly simplifies the code, amen)
c. Calculation of si->dev rotation can overflow when parity==2.
* Then last enable raid6 in ore_verify_layout()
I want to deeply thank Daniel Gryniewicz who found first all the
bugs in the old raid code, and inspired these patches:
Inspired-by Daniel Gryniewicz <dang@linuxbox.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/ore_raid.h')
-rw-r--r-- | fs/exofs/ore_raid.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/exofs/ore_raid.h b/fs/exofs/ore_raid.h index d365bda6beef..cf6375d82129 100644 --- a/fs/exofs/ore_raid.h +++ b/fs/exofs/ore_raid.h @@ -38,7 +38,8 @@ void _ore_free_raid_stuff(struct ore_io_state *ios); void _ore_add_sg_seg(struct ore_per_dev_state *per_dev, unsigned cur_len, bool not_last); int _ore_add_parity_unit(struct ore_io_state *ios, struct ore_striping_info *si, - struct ore_per_dev_state *per_dev, unsigned cur_len); + struct ore_per_dev_state *per_dev, unsigned cur_len, + bool do_xor); void _ore_add_stripe_page(struct __stripe_pages_2d *sp2d, struct ore_striping_info *si, struct page *page); static inline void _add_stripe_page(struct __stripe_pages_2d *sp2d, |