mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
md: centralize ->array_sectors modifications
Get personalities out of the business of directly modifying ->array_sectors. Lays groundwork to introduce policy on when ->array_sectors can be modified. Reviewed-by: Andre Noll <maan@systemlinux.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
80c3a6ce4b
commit
1f403624bd
9 changed files with 20 additions and 11 deletions
|
@ -263,7 +263,7 @@ static int linear_run (mddev_t *mddev)
|
|||
if (!conf)
|
||||
return 1;
|
||||
mddev->private = conf;
|
||||
mddev->array_sectors = linear_size(mddev, 0, 0);
|
||||
md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
|
||||
|
||||
blk_queue_merge_bvec(mddev->queue, linear_mergeable_bvec);
|
||||
mddev->queue->unplug_fn = linear_unplug;
|
||||
|
@ -297,7 +297,7 @@ static int linear_add(mddev_t *mddev, mdk_rdev_t *rdev)
|
|||
newconf->prev = mddev_to_conf(mddev);
|
||||
mddev->private = newconf;
|
||||
mddev->raid_disks++;
|
||||
mddev->array_sectors = linear_size(mddev, 0, 0);
|
||||
md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
|
||||
set_capacity(mddev->gendisk, mddev->array_sectors);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue