diff options
author | Andre Noll <maan@systemlinux.org> | 2009-01-08 16:31:06 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-01-08 16:31:06 -0500 |
commit | 1b7fdf8ff7c0e3fba9c679def4e98d5701d2949e (patch) | |
tree | c24c3a5f0c5f36a2af9b2a860074995b18537d06 /drivers/md | |
parent | 0c3573f19d135d718264e38c46597295bd6154b7 (diff) |
md: raid0_make_request(): Replace chunksize_bits by chunksect_bits.
As ffz(~(2 * x)) = ffz(~x) + 1, we have
chunksect_bits = chunksize_bits + 1.
Fixup all users accordingly.
Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid0.c | 10 |
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) | |||
387 | static int raid0_make_request (struct request_queue *q, struct bio *bio) | 387 | static 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; |