diff options
author | Andre Noll <maan@systemlinux.org> | 2008-07-21 03:05:22 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-07-21 03:05:22 -0400 |
commit | f233ea5c9e0d8b95e4283bf6a3436b88f6fd3586 (patch) | |
tree | 8a36b621de46da23f3957c6e3ea4d653c2937544 /drivers/md/raid5.c | |
parent | 15f4a5fdf3aa07b53f6a7969664741db5882e485 (diff) |
md: Make mddev->array_size sector-based.
This patch renames the array_size field of struct mddev_s to array_sectors
and converts all instances to use units of 512 byte sectors instead of 1k
blocks.
Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 8f4c70a53210..42a480ba767b 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3540,7 +3540,7 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped | |||
3540 | j == raid6_next_disk(sh->pd_idx, sh->disks)) | 3540 | j == raid6_next_disk(sh->pd_idx, sh->disks)) |
3541 | continue; | 3541 | continue; |
3542 | s = compute_blocknr(sh, j); | 3542 | s = compute_blocknr(sh, j); |
3543 | if (s < (mddev->array_size<<1)) { | 3543 | if (s < mddev->array_sectors) { |
3544 | skipped = 1; | 3544 | skipped = 1; |
3545 | continue; | 3545 | continue; |
3546 | } | 3546 | } |
@@ -4189,7 +4189,7 @@ static int run(mddev_t *mddev) | |||
4189 | mddev->queue->backing_dev_info.congested_data = mddev; | 4189 | mddev->queue->backing_dev_info.congested_data = mddev; |
4190 | mddev->queue->backing_dev_info.congested_fn = raid5_congested; | 4190 | mddev->queue->backing_dev_info.congested_fn = raid5_congested; |
4191 | 4191 | ||
4192 | mddev->array_size = mddev->size * (conf->previous_raid_disks - | 4192 | mddev->array_sectors = 2 * mddev->size * (conf->previous_raid_disks - |
4193 | conf->max_degraded); | 4193 | conf->max_degraded); |
4194 | 4194 | ||
4195 | blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec); | 4195 | blk_queue_merge_bvec(mddev->queue, raid5_mergeable_bvec); |
@@ -4413,8 +4413,9 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors) | |||
4413 | raid5_conf_t *conf = mddev_to_conf(mddev); | 4413 | raid5_conf_t *conf = mddev_to_conf(mddev); |
4414 | 4414 | ||
4415 | sectors &= ~((sector_t)mddev->chunk_size/512 - 1); | 4415 | sectors &= ~((sector_t)mddev->chunk_size/512 - 1); |
4416 | mddev->array_size = (sectors * (mddev->raid_disks-conf->max_degraded))>>1; | 4416 | mddev->array_sectors = sectors * (mddev->raid_disks |
4417 | set_capacity(mddev->gendisk, mddev->array_size << 1); | 4417 | - conf->max_degraded); |
4418 | set_capacity(mddev->gendisk, mddev->array_sectors); | ||
4418 | mddev->changed = 1; | 4419 | mddev->changed = 1; |
4419 | if (sectors/2 > mddev->size && mddev->recovery_cp == MaxSector) { | 4420 | if (sectors/2 > mddev->size && mddev->recovery_cp == MaxSector) { |
4420 | mddev->recovery_cp = mddev->size << 1; | 4421 | mddev->recovery_cp = mddev->size << 1; |
@@ -4547,15 +4548,16 @@ static void end_reshape(raid5_conf_t *conf) | |||
4547 | struct block_device *bdev; | 4548 | struct block_device *bdev; |
4548 | 4549 | ||
4549 | if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { | 4550 | if (!test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) { |
4550 | conf->mddev->array_size = conf->mddev->size * | 4551 | conf->mddev->array_sectors = 2 * conf->mddev->size * |
4551 | (conf->raid_disks - conf->max_degraded); | 4552 | (conf->raid_disks - conf->max_degraded); |
4552 | set_capacity(conf->mddev->gendisk, conf->mddev->array_size << 1); | 4553 | set_capacity(conf->mddev->gendisk, conf->mddev->array_sectors); |
4553 | conf->mddev->changed = 1; | 4554 | conf->mddev->changed = 1; |
4554 | 4555 | ||
4555 | bdev = bdget_disk(conf->mddev->gendisk, 0); | 4556 | bdev = bdget_disk(conf->mddev->gendisk, 0); |
4556 | if (bdev) { | 4557 | if (bdev) { |
4557 | mutex_lock(&bdev->bd_inode->i_mutex); | 4558 | mutex_lock(&bdev->bd_inode->i_mutex); |
4558 | i_size_write(bdev->bd_inode, (loff_t)conf->mddev->array_size << 10); | 4559 | i_size_write(bdev->bd_inode, |
4560 | (loff_t)conf->mddev->array_sectors << 9); | ||
4559 | mutex_unlock(&bdev->bd_inode->i_mutex); | 4561 | mutex_unlock(&bdev->bd_inode->i_mutex); |
4560 | bdput(bdev); | 4562 | bdput(bdev); |
4561 | } | 4563 | } |