diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/md/raid0.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index d3a4ce06015a..c3bec024612e 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/blkdev.h> | 21 | #include <linux/blkdev.h> |
22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
23 | #include <linux/slab.h> | ||
23 | #include "md.h" | 24 | #include "md.h" |
24 | #include "raid0.h" | 25 | #include "raid0.h" |
25 | 26 | ||
@@ -176,14 +177,15 @@ static int create_strip_zones(mddev_t *mddev) | |||
176 | disk_stack_limits(mddev->gendisk, rdev1->bdev, | 177 | disk_stack_limits(mddev->gendisk, rdev1->bdev, |
177 | rdev1->data_offset << 9); | 178 | rdev1->data_offset << 9); |
178 | /* as we don't honour merge_bvec_fn, we must never risk | 179 | /* as we don't honour merge_bvec_fn, we must never risk |
179 | * violating it, so limit ->max_sector to one PAGE, as | 180 | * violating it, so limit ->max_segments to 1, lying within |
180 | * a one page request is never in violation. | 181 | * a single page. |
181 | */ | 182 | */ |
182 | 183 | ||
183 | if (rdev1->bdev->bd_disk->queue->merge_bvec_fn && | 184 | if (rdev1->bdev->bd_disk->queue->merge_bvec_fn) { |
184 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) | 185 | blk_queue_max_segments(mddev->queue, 1); |
185 | blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9); | 186 | blk_queue_segment_boundary(mddev->queue, |
186 | 187 | PAGE_CACHE_SIZE - 1); | |
188 | } | ||
187 | if (!smallest || (rdev1->sectors < smallest->sectors)) | 189 | if (!smallest || (rdev1->sectors < smallest->sectors)) |
188 | smallest = rdev1; | 190 | smallest = rdev1; |
189 | cnt++; | 191 | cnt++; |
@@ -325,7 +327,7 @@ static int raid0_run(mddev_t *mddev) | |||
325 | } | 327 | } |
326 | if (md_check_no_bitmap(mddev)) | 328 | if (md_check_no_bitmap(mddev)) |
327 | return -EINVAL; | 329 | return -EINVAL; |
328 | blk_queue_max_sectors(mddev->queue, mddev->chunk_sectors); | 330 | blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors); |
329 | mddev->queue->queue_lock = &mddev->queue->__queue_lock; | 331 | mddev->queue->queue_lock = &mddev->queue->__queue_lock; |
330 | 332 | ||
331 | ret = create_strip_zones(mddev); | 333 | ret = create_strip_zones(mddev); |
@@ -453,7 +455,7 @@ static int raid0_make_request(struct request_queue *q, struct bio *bio) | |||
453 | int cpu; | 455 | int cpu; |
454 | 456 | ||
455 | if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { | 457 | if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { |
456 | bio_endio(bio, -EOPNOTSUPP); | 458 | md_barrier_request(mddev, bio); |
457 | return 0; | 459 | return 0; |
458 | } | 460 | } |
459 | 461 | ||
@@ -567,6 +569,7 @@ static void raid0_exit (void) | |||
567 | module_init(raid0_init); | 569 | module_init(raid0_init); |
568 | module_exit(raid0_exit); | 570 | module_exit(raid0_exit); |
569 | MODULE_LICENSE("GPL"); | 571 | MODULE_LICENSE("GPL"); |
572 | MODULE_DESCRIPTION("RAID0 (striping) personality for MD"); | ||
570 | MODULE_ALIAS("md-personality-2"); /* RAID0 */ | 573 | MODULE_ALIAS("md-personality-2"); /* RAID0 */ |
571 | MODULE_ALIAS("md-raid0"); | 574 | MODULE_ALIAS("md-raid0"); |
572 | MODULE_ALIAS("md-level-0"); | 575 | MODULE_ALIAS("md-level-0"); |