diff options
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index f20b18ff7969..11e384253718 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -273,7 +273,7 @@ static int raid0_mergeable_bvec(struct request_queue *q, | |||
273 | unsigned int chunk_sectors = mddev->chunk_sectors; | 273 | unsigned int chunk_sectors = mddev->chunk_sectors; |
274 | unsigned int bio_sectors = bvm->bi_size >> 9; | 274 | unsigned int bio_sectors = bvm->bi_size >> 9; |
275 | 275 | ||
276 | if (is_power_of_2(mddev->chunk_sectors)) | 276 | if (is_power_of_2(chunk_sectors)) |
277 | max = (chunk_sectors - ((sector & (chunk_sectors-1)) | 277 | max = (chunk_sectors - ((sector & (chunk_sectors-1)) |
278 | + bio_sectors)) << 9; | 278 | + bio_sectors)) << 9; |
279 | else | 279 | else |
@@ -384,7 +384,7 @@ static mdk_rdev_t *map_sector(mddev_t *mddev, struct strip_zone *zone, | |||
384 | raid0_conf_t *conf = mddev->private; | 384 | raid0_conf_t *conf = mddev->private; |
385 | unsigned int chunk_sects = mddev->chunk_sectors; | 385 | unsigned int chunk_sects = mddev->chunk_sectors; |
386 | 386 | ||
387 | if (is_power_of_2(mddev->chunk_sectors)) { | 387 | if (is_power_of_2(chunk_sects)) { |
388 | int chunksect_bits = ffz(~chunk_sects); | 388 | int chunksect_bits = ffz(~chunk_sects); |
389 | /* find the sector offset inside the chunk */ | 389 | /* find the sector offset inside the chunk */ |
390 | sect_in_chunk = sector & (chunk_sects - 1); | 390 | sect_in_chunk = sector & (chunk_sects - 1); |
@@ -414,7 +414,7 @@ static mdk_rdev_t *map_sector(mddev_t *mddev, struct strip_zone *zone, | |||
414 | static inline int is_io_in_chunk_boundary(mddev_t *mddev, | 414 | static inline int is_io_in_chunk_boundary(mddev_t *mddev, |
415 | unsigned int chunk_sects, struct bio *bio) | 415 | unsigned int chunk_sects, struct bio *bio) |
416 | { | 416 | { |
417 | if (likely(is_power_of_2(mddev->chunk_sectors))) { | 417 | if (likely(is_power_of_2(chunk_sects))) { |
418 | return chunk_sects >= ((bio->bi_sector & (chunk_sects-1)) | 418 | return chunk_sects >= ((bio->bi_sector & (chunk_sects-1)) |
419 | + (bio->bi_size >> 9)); | 419 | + (bio->bi_size >> 9)); |
420 | } else{ | 420 | } else{ |
@@ -456,7 +456,7 @@ static int raid0_make_request(struct request_queue *q, struct bio *bio) | |||
456 | /* This is a one page bio that upper layers | 456 | /* This is a one page bio that upper layers |
457 | * refuse to split for us, so we need to split it. | 457 | * refuse to split for us, so we need to split it. |
458 | */ | 458 | */ |
459 | if (likely(is_power_of_2(mddev->chunk_sectors))) | 459 | if (likely(is_power_of_2(chunk_sects))) |
460 | bp = bio_split(bio, chunk_sects - (sector & | 460 | bp = bio_split(bio, chunk_sects - (sector & |
461 | (chunk_sects-1))); | 461 | (chunk_sects-1))); |
462 | else | 462 | else |