summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-01-09 08:31:06 +1100
committerNeilBrown <neilb@suse.de>2009-01-09 08:31:06 +1100
commit1b7fdf8ff7c0e3fba9c679def4e98d5701d2949e (patch)
treec24c3a5f0c5f36a2af9b2a860074995b18537d06 /drivers/md
parent0c3573f19d135d718264e38c46597295bd6154b7 (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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 8ac6488ad0d..62a193c2a25 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -387,7 +387,7 @@ static int raid0_stop (mddev_t *mddev)
static int raid0_make_request (struct request_queue *q, struct bio *bio)
{
mddev_t *mddev = q->queuedata;
- unsigned int sect_in_chunk, chunksize_bits, chunk_size, chunk_sects;
+ unsigned int sect_in_chunk, chunksect_bits, chunk_size, chunk_sects;
raid0_conf_t *conf = mddev_to_conf(mddev);
struct strip_zone *zone;
mdk_rdev_t *tmp_dev;
@@ -409,7 +409,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
chunk_size = mddev->chunk_size >> 10;
chunk_sects = mddev->chunk_size >> 9;
- chunksize_bits = ffz(~chunk_size);
+ chunksect_bits = ffz(~chunk_sects);
block = bio->bi_sector >> 1;
@@ -446,15 +446,15 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
{
- sector_t x = (block - zone->zone_offset) >> chunksize_bits;
+ sector_t x = (block - zone->zone_offset) >> (chunksect_bits - 1);
sector_div(x, zone->nb_dev);
chunk = x;
- x = block >> chunksize_bits;
+ x = block >> (chunksect_bits - 1);
tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
}
- rsect = (((chunk << chunksize_bits) + zone->dev_offset)<<1)
+ rsect = (((chunk << (chunksect_bits - 1)) + zone->dev_offset)<<1)
+ sect_in_chunk;
bio->bi_bdev = tmp_dev->bdev;