aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-01-08 16:31:06 -0500
committerNeilBrown <neilb@suse.de>2009-01-08 16:31:06 -0500
commita471200595b24fb1907ad12107a6a66db02c63f2 (patch)
tree55c04f45ca294cdd765d386a4f2539e4f4d7b069 /drivers/md/raid0.c
parent1b7fdf8ff7c0e3fba9c679def4e98d5701d2949e (diff)
md: raid0_make_request(): Remove local variable chunk_size.
We might as well use chunk_sects instead. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 62a193c2a25e..d8438494e9db 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, chunksect_bits, chunk_size, chunk_sects; 390 unsigned int sect_in_chunk, chunksect_bits, 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;
@@ -407,7 +407,6 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
407 bio_sectors(bio)); 407 bio_sectors(bio));
408 part_stat_unlock(); 408 part_stat_unlock();
409 409
410 chunk_size = mddev->chunk_size >> 10;
411 chunk_sects = mddev->chunk_size >> 9; 410 chunk_sects = mddev->chunk_size >> 9;
412 chunksect_bits = ffz(~chunk_sects); 411 chunksect_bits = ffz(~chunk_sects);
413 block = bio->bi_sector >> 1; 412 block = bio->bi_sector >> 1;
@@ -442,7 +441,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
442 while (block >= (zone->zone_offset + zone->size)) 441 while (block >= (zone->zone_offset + zone->size))
443 zone++; 442 zone++;
444 443
445 sect_in_chunk = bio->bi_sector & ((chunk_size<<1) -1); 444 sect_in_chunk = bio->bi_sector & (chunk_sects - 1);
446 445
447 446
448 { 447 {
@@ -467,7 +466,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
467 466
468bad_map: 467bad_map:
469 printk("raid0_make_request bug: can't convert block across chunks" 468 printk("raid0_make_request bug: can't convert block across chunks"
470 " or bigger than %dk %llu %d\n", chunk_size, 469 " or bigger than %dk %llu %d\n", chunk_sects / 2,
471 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 470 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
472 471
473 bio_io_error(bio); 472 bio_io_error(bio);