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/raid1.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/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 491dc2d4ad5..03a5ab705c2 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -2043,7 +2043,7 @@ static int run(mddev_t *mddev) | |||
2043 | /* | 2043 | /* |
2044 | * Ok, everything is just fine now | 2044 | * Ok, everything is just fine now |
2045 | */ | 2045 | */ |
2046 | mddev->array_size = mddev->size; | 2046 | mddev->array_sectors = mddev->size * 2; |
2047 | 2047 | ||
2048 | mddev->queue->unplug_fn = raid1_unplug; | 2048 | mddev->queue->unplug_fn = raid1_unplug; |
2049 | mddev->queue->backing_dev_info.congested_fn = raid1_congested; | 2049 | mddev->queue->backing_dev_info.congested_fn = raid1_congested; |
@@ -2105,14 +2105,15 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors) | |||
2105 | * any io in the removed space completes, but it hardly seems | 2105 | * any io in the removed space completes, but it hardly seems |
2106 | * worth it. | 2106 | * worth it. |
2107 | */ | 2107 | */ |
2108 | mddev->array_size = sectors>>1; | 2108 | mddev->array_sectors = sectors; |
2109 | set_capacity(mddev->gendisk, mddev->array_size << 1); | 2109 | set_capacity(mddev->gendisk, mddev->array_sectors); |
2110 | mddev->changed = 1; | 2110 | mddev->changed = 1; |
2111 | if (mddev->array_size > mddev->size && mddev->recovery_cp == MaxSector) { | 2111 | if (mddev->array_sectors / 2 > mddev->size && |
2112 | mddev->recovery_cp == MaxSector) { | ||
2112 | mddev->recovery_cp = mddev->size << 1; | 2113 | mddev->recovery_cp = mddev->size << 1; |
2113 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 2114 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
2114 | } | 2115 | } |
2115 | mddev->size = mddev->array_size; | 2116 | mddev->size = mddev->array_sectors / 2; |
2116 | mddev->resync_max_sectors = sectors; | 2117 | mddev->resync_max_sectors = sectors; |
2117 | return 0; | 2118 | return 0; |
2118 | } | 2119 | } |