xref: /linux/drivers/md/raid0.h (revision dc58266385e51420298275c90a616c34f1473a73)
1ef740c37SChristoph Hellwig #ifndef _RAID0_H
2ef740c37SChristoph Hellwig #define _RAID0_H
3ef740c37SChristoph Hellwig 
4ef740c37SChristoph Hellwig struct strip_zone
5ef740c37SChristoph Hellwig {
6*dc582663SAndre Noll 	sector_t zone_end;	/* Start of the next zone (in sectors) */
7ef740c37SChristoph Hellwig 	sector_t dev_start;	/* Zone offset in real dev (in sectors) */
8ef740c37SChristoph Hellwig 	sector_t sectors;	/* Zone size in sectors */
9ef740c37SChristoph Hellwig 	int nb_dev;		/* # of devices attached to the zone */
10ef740c37SChristoph Hellwig 	mdk_rdev_t **dev;	/* Devices attached to the zone */
11ef740c37SChristoph Hellwig };
12ef740c37SChristoph Hellwig 
13ef740c37SChristoph Hellwig struct raid0_private_data
14ef740c37SChristoph Hellwig {
15ef740c37SChristoph Hellwig 	struct strip_zone **hash_table; /* Table of indexes into strip_zone */
16ef740c37SChristoph Hellwig 	struct strip_zone *strip_zone;
17ef740c37SChristoph Hellwig 	mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */
18ef740c37SChristoph Hellwig 	int nr_strip_zones;
19ef740c37SChristoph Hellwig 
20ef740c37SChristoph Hellwig 	sector_t spacing;
21ef740c37SChristoph Hellwig 	int sector_shift; /* shift this before divide by spacing */
22ef740c37SChristoph Hellwig };
23ef740c37SChristoph Hellwig 
24ef740c37SChristoph Hellwig typedef struct raid0_private_data raid0_conf_t;
25ef740c37SChristoph Hellwig 
26ef740c37SChristoph Hellwig #define mddev_to_conf(mddev) ((raid0_conf_t *) mddev->private)
27ef740c37SChristoph Hellwig 
28ef740c37SChristoph Hellwig #endif
29