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/md.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/md.c')
-rw-r--r-- | drivers/md/md.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index df13a17a9627..4bfbc1982cda 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3704,7 +3704,7 @@ static int do_md_run(mddev_t * mddev) | |||
3704 | if (mddev->flags) | 3704 | if (mddev->flags) |
3705 | md_update_sb(mddev, 0); | 3705 | md_update_sb(mddev, 0); |
3706 | 3706 | ||
3707 | set_capacity(disk, mddev->array_size<<1); | 3707 | set_capacity(disk, mddev->array_sectors); |
3708 | 3708 | ||
3709 | /* If we call blk_queue_make_request here, it will | 3709 | /* If we call blk_queue_make_request here, it will |
3710 | * re-initialise max_sectors etc which may have been | 3710 | * re-initialise max_sectors etc which may have been |
@@ -3905,7 +3905,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
3905 | 3905 | ||
3906 | export_array(mddev); | 3906 | export_array(mddev); |
3907 | 3907 | ||
3908 | mddev->array_size = 0; | 3908 | mddev->array_sectors = 0; |
3909 | mddev->size = 0; | 3909 | mddev->size = 0; |
3910 | mddev->raid_disks = 0; | 3910 | mddev->raid_disks = 0; |
3911 | mddev->recovery_cp = 0; | 3911 | mddev->recovery_cp = 0; |
@@ -4644,7 +4644,8 @@ static int update_size(mddev_t *mddev, sector_t num_sectors) | |||
4644 | bdev = bdget_disk(mddev->gendisk, 0); | 4644 | bdev = bdget_disk(mddev->gendisk, 0); |
4645 | if (bdev) { | 4645 | if (bdev) { |
4646 | mutex_lock(&bdev->bd_inode->i_mutex); | 4646 | mutex_lock(&bdev->bd_inode->i_mutex); |
4647 | i_size_write(bdev->bd_inode, (loff_t)mddev->array_size << 10); | 4647 | i_size_write(bdev->bd_inode, |
4648 | (loff_t)mddev->array_sectors << 9); | ||
4648 | mutex_unlock(&bdev->bd_inode->i_mutex); | 4649 | mutex_unlock(&bdev->bd_inode->i_mutex); |
4649 | bdput(bdev); | 4650 | bdput(bdev); |
4650 | } | 4651 | } |
@@ -5391,10 +5392,11 @@ static int md_seq_show(struct seq_file *seq, void *v) | |||
5391 | if (!list_empty(&mddev->disks)) { | 5392 | if (!list_empty(&mddev->disks)) { |
5392 | if (mddev->pers) | 5393 | if (mddev->pers) |
5393 | seq_printf(seq, "\n %llu blocks", | 5394 | seq_printf(seq, "\n %llu blocks", |
5394 | (unsigned long long)mddev->array_size); | 5395 | (unsigned long long) |
5396 | mddev->array_sectors / 2); | ||
5395 | else | 5397 | else |
5396 | seq_printf(seq, "\n %llu blocks", | 5398 | seq_printf(seq, "\n %llu blocks", |
5397 | (unsigned long long)size); | 5399 | (unsigned long long)size); |
5398 | } | 5400 | } |
5399 | if (mddev->persistent) { | 5401 | if (mddev->persistent) { |
5400 | if (mddev->major_version != 0 || | 5402 | if (mddev->major_version != 0 || |