提交 019c4e2f 编写于 作者: A Andre Noll 提交者: NeilBrown

md: raid0: Represent device offset in sectors.

Rename zone->dev_offset to zone->dev_start to make sure all users
have been converted.
Signed-off-by: NAndre Noll <maan@systemlinux.org>
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 e0f06868
...@@ -167,7 +167,7 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -167,7 +167,7 @@ static int create_strip_zones (mddev_t *mddev)
zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks; zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks;
printk("raid0: zone %d\n", i); printk("raid0: zone %d\n", i);
zone->dev_offset = current_offset; zone->dev_start = current_offset * 2;
smallest = NULL; smallest = NULL;
c = 0; c = 0;
...@@ -452,8 +452,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio) ...@@ -452,8 +452,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
x = sector >> chunksect_bits; x = sector >> chunksect_bits;
tmp_dev = zone->dev[sector_div(x, zone->nb_dev)]; tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
} }
rsect = (((chunk << (chunksect_bits - 1)) + zone->dev_offset)<<1) rsect = (chunk << chunksect_bits) + zone->dev_start + sect_in_chunk;
+ sect_in_chunk;
bio->bi_bdev = tmp_dev->bdev; bio->bi_bdev = tmp_dev->bdev;
bio->bi_sector = rsect + tmp_dev->data_offset; bio->bi_sector = rsect + tmp_dev->data_offset;
...@@ -490,9 +489,9 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev) ...@@ -490,9 +489,9 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev)
seq_printf(seq, "%s/", bdevname( seq_printf(seq, "%s/", bdevname(
conf->strip_zone[j].dev[k]->bdev,b)); conf->strip_zone[j].dev[k]->bdev,b));
seq_printf(seq, "] zo=%d do=%d s=%d\n", seq_printf(seq, "] zo=%d ds=%d s=%d\n",
conf->strip_zone[j].zone_offset, conf->strip_zone[j].zone_offset,
conf->strip_zone[j].dev_offset, conf->strip_zone[j].dev_start,
conf->strip_zone[j].size); conf->strip_zone[j].size);
} }
#endif #endif
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
struct strip_zone struct strip_zone
{ {
sector_t zone_offset; /* Zone offset in md_dev */ sector_t zone_offset; /* Zone offset in md_dev */
sector_t dev_offset; /* Zone offset in real dev */ sector_t dev_start; /* Zone offset in real dev (in sectors) */
sector_t size; /* Zone size */ sector_t size; /* Zone size */
int nb_dev; /* # of devices attached to the zone */ int nb_dev; /* # of devices attached to the zone */
mdk_rdev_t **dev; /* Devices attached to the zone */ mdk_rdev_t **dev; /* Devices attached to the zone */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册