aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-03-30 23:59:03 -0400
committerDan Williams <dan.j.williams@intel.com>2009-03-30 23:59:03 -0400
commit1f403624bde3c678a166984b1e6a727a0ce06f2b (patch)
treeb66ed37091e825bcde1cd0d333d4ebba86772805 /drivers/md/raid5.c
parent80c3a6ce4ba4470379b9e6a4d9bcd9d2ee26ae03 (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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 2cd619ff0761..2930fc26a852 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4474,7 +4474,7 @@ static int run(mddev_t *mddev)
4474 mddev->queue->backing_dev_info.congested_data = mddev; 4474 mddev->queue->backing_dev_info.congested_data = mddev;
4475 mddev->queue->backing_dev_info.congested_fn = raid5_congested; 4475 mddev->queue->backing_dev_info.congested_fn = raid5_congested;
4476 4476
4477 mddev->array_sectors = raid5_size(mddev, 0, 0); 4477 md_set_array_sectors(mddev, raid5_size(mddev, 0, 0));
4478 4478
4479 blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec); 4479 blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec);
4480 4480
@@ -4698,7 +4698,8 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors)
4698 * worth it. 4698 * worth it.
4699 */ 4699 */
4700 sectors &= ~((sector_t)mddev->chunk_size/512 - 1); 4700 sectors &= ~((sector_t)mddev->chunk_size/512 - 1);
4701 mddev->array_sectors = raid5_size(mddev, sectors, mddev->raid_disks); 4701 md_set_array_sectors(mddev, raid5_size(mddev, sectors,
4702 mddev->raid_disks));
4702 set_capacity(mddev->gendisk, mddev->array_sectors); 4703 set_capacity(mddev->gendisk, mddev->array_sectors);
4703 mddev->changed = 1; 4704 mddev->changed = 1;
4704 if (sectors > mddev->dev_sectors && mddev->recovery_cp == MaxSector) { 4705 if (sectors > mddev->dev_sectors && mddev->recovery_cp == MaxSector) {
@@ -4836,7 +4837,8 @@ static void end_reshape(raid5_conf_t *conf)
4836 if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { 4837 if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) {
4837 mddev_t *mddev = conf->mddev; 4838 mddev_t *mddev = conf->mddev;
4838 4839
4839 mddev->array_sectors = raid5_size(mddev, 0, conf->raid_disks); 4840 md_set_array_sectors(mddev, raid5_size(mddev, 0,
4841 conf->raid_disks));
4840 set_capacity(mddev->gendisk, mddev->array_sectors); 4842 set_capacity(mddev->gendisk, mddev->array_sectors);
4841 mddev->changed = 1; 4843 mddev->changed = 1;
4842 conf->previous_raid_disks = conf->raid_disks; 4844 conf->previous_raid_disks = conf->raid_disks;