Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef _RAID0_H |
| 3 | #define _RAID0_H |
| 4 | |
NeilBrown | e373ab1 | 2011-10-11 16:48:59 +1100 | [diff] [blame] | 5 | struct strip_zone { |
Andre Noll | dc58266 | 2009-06-16 16:18:43 +1000 | [diff] [blame] | 6 | sector_t zone_end; /* Start of the next zone (in sectors) */ |
Andre Noll | 019c4e2 | 2009-01-09 08:31:06 +1100 | [diff] [blame] | 7 | sector_t dev_start; /* Zone offset in real dev (in sectors) */ |
NeilBrown | ba13da4 | 2012-03-19 12:46:39 +1100 | [diff] [blame] | 8 | int nb_dev; /* # of devices attached to the zone */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | }; |
| 10 | |
NeilBrown | c84a137 | 2019-09-09 16:30:02 +1000 | [diff] [blame] | 11 | /* Linux 3.14 (20d0189b101) made an unintended change to |
| 12 | * the RAID0 layout for multi-zone arrays (where devices aren't all |
| 13 | * the same size. |
| 14 | * RAID0_ORIG_LAYOUT restores the original layout |
| 15 | * RAID0_ALT_MULTIZONE_LAYOUT uses the altered layout |
| 16 | * The layouts are identical when there is only one zone (all |
| 17 | * devices the same size). |
| 18 | */ |
| 19 | |
| 20 | enum r0layout { |
| 21 | RAID0_ORIG_LAYOUT = 1, |
| 22 | RAID0_ALT_MULTIZONE_LAYOUT = 2, |
| 23 | }; |
NeilBrown | e373ab1 | 2011-10-11 16:48:59 +1100 | [diff] [blame] | 24 | struct r0conf { |
NeilBrown | ba13da4 | 2012-03-19 12:46:39 +1100 | [diff] [blame] | 25 | struct strip_zone *strip_zone; |
| 26 | struct md_rdev **devlist; /* lists of rdevs, pointed to |
| 27 | * by strip_zone->dev */ |
| 28 | int nr_strip_zones; |
NeilBrown | c84a137 | 2019-09-09 16:30:02 +1000 | [diff] [blame] | 29 | enum r0layout layout; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | }; |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #endif |