Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127718
b: refs/heads/master
c: 1b7fdf8
h: refs/heads/master
v: v3
  • Loading branch information
Andre Noll authored and NeilBrown committed Jan 8, 2009
1 parent 00c2eba commit 3d7833f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c3573f19d135d718264e38c46597295bd6154b7
refs/heads/master: 1b7fdf8ff7c0e3fba9c679def4e98d5701d2949e
10 changes: 5 additions & 5 deletions trunk/drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;


Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3d7833f

Please sign in to comment.