1、raid5私有数据结构定义为raid5_conf_t:
struct raid5_private_data {
struct hlist_head *stripe_hashtbl; //所有的stripe_head通过hash连接件链入哈希表的哈希表头
mddev_t *mddev; //管理MD设备的描述符指针
struct disk_info *spare;
int chunk_sectors; //MD设备的chunk大小,可以设置
int level, algorithm; //
int max_degraded; //
int raid_disks; //raid5中成员磁盘的个数
int max_nr_stripes; //最大的stripe个数,初始为256
/* reshape_progress is the leading edge of a 'reshape'
* It has value MaxSector when no reshape is happening
* If delta_disks < 0, it is the last sector we started work on,
* else is it the next sector to work on.
*/
sector_t reshape_progress;
/* reshape_safe is the trailing edge of a reshape. We know that
* before (or after) this address, all reshape has completed.
*/
sector_t reshape_safe;
int previous_raid_disks;
int prev_chunk_sectors;
int prev_algo;
short generation; /* increments with every reshape */
unsigned long reshape_checkpoint; /* Time we last updated
* metadata */
struct list_head handle_list; /* stripes needing handling */
struct list_head hold_list; /* preread ready stripes */
struct list_head delayed_list; /* stripes that have plugged requests */
struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */
struct bio *retry_read_aligned; /* currently retrying aligned bios */
struct bio *retry_read_aligned_list; /* aligned bios retr