Commit 89670a77 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: Remove dependance on MD_SB_DISKS in linear personality

Linear uses one array sized by MD_SB_DISKS inside a structure.
We move it to the end of the structure, declare it as size 0,
and arrange for approprate extra space to be allocated on
structure allocation.
parent 31458043
......@@ -89,7 +89,8 @@ static int linear_run (mddev_t *mddev)
unsigned int curr_offset;
struct list_head *tmp;
conf = kmalloc (sizeof (*conf), GFP_KERNEL);
conf = kmalloc (sizeof (*conf) + mddev->raid_disks*sizeof(dev_info_t),
GFP_KERNEL);
if (!conf)
goto out;
memset(conf, 0, sizeof(*conf));
......
......@@ -19,9 +19,9 @@ struct linear_hash
struct linear_private_data
{
struct linear_hash *hash_table;
dev_info_t disks[MD_SB_DISKS];
dev_info_t *smallest;
int nr_zones;
dev_info_t disks[0];
};
......
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