diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-03-31 14:59:03 +1100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-03-31 14:59:03 +1100 |
commit | 1f403624bde3c678a166984b1e6a727a0ce06f2b (patch) | |
tree | b66ed37091e825bcde1cd0d333d4ebba86772805 /drivers/md/raid5.c | |
parent | 80c3a6ce4ba4470379b9e6a4d9bcd9d2ee26ae03 (diff) |
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>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 2cd619ff076..2930fc26a85 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4474,7 +4474,7 @@ static int run(mddev_t *mddev) mddev->queue->backing_dev_info.congested_data = mddev; mddev->queue->backing_dev_info.congested_fn = raid5_congested; - mddev->array_sectors = raid5_size(mddev, 0, 0); + md_set_array_sectors(mddev, raid5_size(mddev, 0, 0)); blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec); @@ -4698,7 +4698,8 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors) * worth it. */ sectors &= ~((sector_t)mddev->chunk_size/512 - 1); - mddev->array_sectors = raid5_size(mddev, sectors, mddev->raid_disks); + md_set_array_sectors(mddev, raid5_size(mddev, sectors, + mddev->raid_disks)); set_capacity(mddev->gendisk, mddev->array_sectors); mddev->changed = 1; if (sectors > mddev->dev_sectors && mddev->recovery_cp == MaxSector) { @@ -4836,7 +4837,8 @@ static void end_reshape(raid5_conf_t *conf) if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { mddev_t *mddev = conf->mddev; - mddev->array_sectors = raid5_size(mddev, 0, conf->raid_disks); + md_set_array_sectors(mddev, raid5_size(mddev, 0, + conf->raid_disks)); set_capacity(mddev->gendisk, mddev->array_sectors); mddev->changed = 1; conf->previous_raid_disks = conf->raid_disks; |