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