aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/raid0.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 8ac6488ad0dc..62a193c2a25e 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -387,7 +387,7 @@ static int raid0_stop (mddev_t *mddev)
387static int raid0_make_request (struct request_queue *q, struct bio *bio) 387static int raid0_make_request (struct request_queue *q, struct bio *bio)
388{ 388{
389 mddev_t *mddev = q->queuedata; 389 mddev_t *mddev = q->queuedata;
390 unsigned int sect_in_chunk, chunksize_bits, chunk_size, chunk_sects; 390 unsigned int sect_in_chunk, chunksect_bits, chunk_size, chunk_sects;
391 raid0_conf_t *conf = mddev_to_conf(mddev); 391 raid0_conf_t *conf = mddev_to_conf(mddev);
392 struct strip_zone *zone; 392 struct strip_zone *zone;
393 mdk_rdev_t *tmp_dev; 393 mdk_rdev_t *tmp_dev;
@@ -409,7 +409,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
409 409
410 chunk_size = mddev->chunk_size >> 10; 410 chunk_size = mddev->chunk_size >> 10;
411 chunk_sects = mddev->chunk_size >> 9; 411 chunk_sects = mddev->chunk_size >> 9;
412 chunksize_bits = ffz(~chunk_size); 412 chunksect_bits = ffz(~chunk_sects);
413 block = bio->bi_sector >> 1; 413 block = bio->bi_sector >> 1;
414 414
415 415
@@ -446,15 +446,15 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
446 446
447 447
448 { 448 {
449 sector_t x = (block - zone->zone_offset) >> chunksize_bits; 449 sector_t x = (block - zone->zone_offset) >> (chunksect_bits - 1);
450 450
451 sector_div(x, zone->nb_dev); 451 sector_div(x, zone->nb_dev);
452 chunk = x; 452 chunk = x;
453 453
454 x = block >> chunksize_bits; 454 x = block >> (chunksect_bits - 1);
455 tmp_dev = zone->dev[sector_div(x, zone->nb_dev)]; 455 tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
456 } 456 }
457 rsect = (((chunk << chunksize_bits) + zone->dev_offset)<<1) 457 rsect = (((chunk << (chunksect_bits - 1)) + zone->dev_offset)<<1)
458 + sect_in_chunk; 458 + sect_in_chunk;
459 459
460 bio->bi_bdev = tmp_dev->bdev; 460 bio->bi_bdev = tmp_dev->bdev;