aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-08 13:13:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-08 13:13:35 -0400
commit4de13d7aa8f4d02f4dc99d4609575659f92b3c5a (patch)
tree3bc9729eabe79c6164cd29a5d605000bc82bf837 /drivers/md/raid0.c
parent5af43c24ca59a448c9312dd4a4a51d27ec3b9a73 (diff)
parentb8d4a5bf6a049303a29a3275f463f09a490b50ea (diff)
Merge branch 'for-3.10/core' of git://git.kernel.dk/linux-block
Pull block core updates from Jens Axboe: - Major bit is Kents prep work for immutable bio vecs. - Stable candidate fix for a scheduling-while-atomic in the queue bypass operation. - Fix for the hang on exceeded rq->datalen 32-bit unsigned when merging discard bios. - Tejuns changes to convert the writeback thread pool to the generic workqueue mechanism. - Runtime PM framework, SCSI patches exists on top of these in James' tree. - A few random fixes. * 'for-3.10/core' of git://git.kernel.dk/linux-block: (40 commits) relay: move remove_buf_file inside relay_close_buf partitions/efi.c: replace useless kzalloc's by kmalloc's fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read() block: fix max discard sectors limit blkcg: fix "scheduling while atomic" in blk_queue_bypass_start Documentation: cfq-iosched: update documentation help for cfq tunables writeback: expose the bdi_wq workqueue writeback: replace custom worker pool implementation with unbound workqueue writeback: remove unused bdi_pending_list aoe: Fix unitialized var usage bio-integrity: Add explicit field for owner of bip_buf block: Add an explicit bio flag for bios that own their bvec block: Add bio_alloc_pages() block: Convert some code to bio_for_each_segment_all() block: Add bio_for_each_segment_all() bounce: Refactor __blk_queue_bounce to not use bi_io_vec raid1: use bio_copy_data() pktcdvd: Use bio_reset() in disabled code to kill bi_idx usage pktcdvd: use bio_copy_data() block: Add bio_copy_data() ...
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 0505452de8d6..fcf65e512cf5 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -502,11 +502,11 @@ static inline int is_io_in_chunk_boundary(struct mddev *mddev,
502{ 502{
503 if (likely(is_power_of_2(chunk_sects))) { 503 if (likely(is_power_of_2(chunk_sects))) {
504 return chunk_sects >= ((bio->bi_sector & (chunk_sects-1)) 504 return chunk_sects >= ((bio->bi_sector & (chunk_sects-1))
505 + (bio->bi_size >> 9)); 505 + bio_sectors(bio));
506 } else{ 506 } else{
507 sector_t sector = bio->bi_sector; 507 sector_t sector = bio->bi_sector;
508 return chunk_sects >= (sector_div(sector, chunk_sects) 508 return chunk_sects >= (sector_div(sector, chunk_sects)
509 + (bio->bi_size >> 9)); 509 + bio_sectors(bio));
510 } 510 }
511} 511}
512 512
@@ -527,8 +527,7 @@ static void raid0_make_request(struct mddev *mddev, struct bio *bio)
527 sector_t sector = bio->bi_sector; 527 sector_t sector = bio->bi_sector;
528 struct bio_pair *bp; 528 struct bio_pair *bp;
529 /* Sanity check -- queue functions should prevent this happening */ 529 /* Sanity check -- queue functions should prevent this happening */
530 if ((bio->bi_vcnt != 1 && bio->bi_vcnt != 0) || 530 if (bio_segments(bio) > 1)
531 bio->bi_idx != 0)
532 goto bad_map; 531 goto bad_map;
533 /* This is a one page bio that upper layers 532 /* This is a one page bio that upper layers
534 * refuse to split for us, so we need to split it. 533 * refuse to split for us, so we need to split it.
@@ -567,7 +566,7 @@ bad_map:
567 printk("md/raid0:%s: make_request bug: can't convert block across chunks" 566 printk("md/raid0:%s: make_request bug: can't convert block across chunks"
568 " or bigger than %dk %llu %d\n", 567 " or bigger than %dk %llu %d\n",
569 mdname(mddev), chunk_sects / 2, 568 mdname(mddev), chunk_sects / 2,
570 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 569 (unsigned long long)bio->bi_sector, bio_sectors(bio) / 2);
571 570
572 bio_io_error(bio); 571 bio_io_error(bio);
573 return; 572 return;