Commit 50ebb04c authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: Remove dependancy on MD_SB_DISKS from raid5

One embeded array gets moved to end of structure and
sized dynamically.
parent 91dd54ad
......@@ -1452,7 +1452,9 @@ static int run (mddev_t *mddev)
return -EIO;
}
mddev->private = kmalloc (sizeof (raid5_conf_t), GFP_KERNEL);
mddev->private = kmalloc (sizeof (raid5_conf_t)
+ mddev->raid_disks * sizeof(struct disk_info),
GFP_KERNEL);
if ((conf = mddev->private) == NULL)
goto abort;
memset (conf, 0, sizeof (*conf));
......
......@@ -202,7 +202,6 @@ struct disk_info {
struct raid5_private_data {
struct stripe_head **stripe_hashtbl;
mddev_t *mddev;
struct disk_info disks[MD_SB_DISKS];
struct disk_info *spare;
int chunk_size, level, algorithm;
int raid_disks, working_disks, failed_disks;
......@@ -224,6 +223,7 @@ struct raid5_private_data {
* waiting for 25% to be free
*/
spinlock_t device_lock;
struct disk_info disks[0];
};
typedef struct raid5_private_data raid5_conf_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment