^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _RAID0_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _RAID0_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) struct strip_zone {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) sector_t zone_end; /* Start of the next zone (in sectors) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) sector_t dev_start; /* Zone offset in real dev (in sectors) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) int nb_dev; /* # of devices attached to the zone */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) /* Linux 3.14 (20d0189b101) made an unintended change to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * the RAID0 layout for multi-zone arrays (where devices aren't all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * the same size.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * RAID0_ORIG_LAYOUT restores the original layout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * RAID0_ALT_MULTIZONE_LAYOUT uses the altered layout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * The layouts are identical when there is only one zone (all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * devices the same size).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) enum r0layout {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) RAID0_ORIG_LAYOUT = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) RAID0_ALT_MULTIZONE_LAYOUT = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct r0conf {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct strip_zone *strip_zone;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct md_rdev **devlist; /* lists of rdevs, pointed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * by strip_zone->dev */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) int nr_strip_zones;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) enum r0layout layout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #endif