summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-03-31 05:59:03 +0200
committerDan Williams <dan.j.williams@intel.com>2009-03-31 05:59:03 +0200
commit1f403624bde3c678a166984b1e6a727a0ce06f2b (patch)
treeb66ed37091e825bcde1cd0d333d4ebba86772805 /drivers/md/raid5.c
parentmd: add 'size' as a personality method (diff)
downloadlinux-1f403624bde3c678a166984b1e6a727a0ce06f2b.tar.xz
linux-1f403624bde3c678a166984b1e6a727a0ce06f2b.zip
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 '')
-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)
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;