aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/raid0.c9
-rw-r--r--include/linux/raid/raid0.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index fd65d8806c0f..b860536dc894 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -167,7 +167,7 @@ static int create_strip_zones (mddev_t *mddev)
167 zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks; 167 zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks;
168 168
169 printk("raid0: zone %d\n", i); 169 printk("raid0: zone %d\n", i);
170 zone->dev_offset = current_offset; 170 zone->dev_start = current_offset * 2;
171 smallest = NULL; 171 smallest = NULL;
172 c = 0; 172 c = 0;
173 173
@@ -452,8 +452,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
452 x = sector >> chunksect_bits; 452 x = sector >> chunksect_bits;
453 tmp_dev = zone->dev[sector_div(x, zone->nb_dev)]; 453 tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
454 } 454 }
455 rsect = (((chunk << (chunksect_bits - 1)) + zone->dev_offset)<<1) 455 rsect = (chunk << chunksect_bits) + zone->dev_start + sect_in_chunk;
456 + sect_in_chunk;
457 456
458 bio->bi_bdev = tmp_dev->bdev; 457 bio->bi_bdev = tmp_dev->bdev;
459 bio->bi_sector = rsect + tmp_dev->data_offset; 458 bio->bi_sector = rsect + tmp_dev->data_offset;
@@ -490,9 +489,9 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev)
490 seq_printf(seq, "%s/", bdevname( 489 seq_printf(seq, "%s/", bdevname(
491 conf->strip_zone[j].dev[k]->bdev,b)); 490 conf->strip_zone[j].dev[k]->bdev,b));
492 491
493 seq_printf(seq, "] zo=%d do=%d s=%d\n", 492 seq_printf(seq, "] zo=%d ds=%d s=%d\n",
494 conf->strip_zone[j].zone_offset, 493 conf->strip_zone[j].zone_offset,
495 conf->strip_zone[j].dev_offset, 494 conf->strip_zone[j].dev_start,
496 conf->strip_zone[j].size); 495 conf->strip_zone[j].size);
497 } 496 }
498#endif 497#endif
diff --git a/include/linux/raid/raid0.h b/include/linux/raid/raid0.h
index 1b2dda035f8e..61c3d29dc158 100644
--- a/include/linux/raid/raid0.h
+++ b/include/linux/raid/raid0.h
@@ -6,7 +6,7 @@
6struct strip_zone 6struct strip_zone
7{ 7{
8 sector_t zone_offset; /* Zone offset in md_dev */ 8 sector_t zone_offset; /* Zone offset in md_dev */
9 sector_t dev_offset; /* Zone offset in real dev */ 9 sector_t dev_start; /* Zone offset in real dev (in sectors) */
10 sector_t size; /* Zone size */ 10 sector_t size; /* Zone size */
11 int nb_dev; /* # of devices attached to the zone */ 11 int nb_dev; /* # of devices attached to the zone */
12 mdk_rdev_t **dev; /* Devices attached to the zone */ 12 mdk_rdev_t **dev; /* Devices attached to the zone */