aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-04-23 02:08:44 +0200
committerJiri Kosina <jkosina@suse.cz>2010-04-23 02:08:44 +0200
commit6c9468e9eb1252eaefd94ce7f06e1be9b0b641b1 (patch)
tree797676a336b050bfa1ef879377c07e541b9075d6 /drivers/md/raid0.c
parentUML: Fix compiler warning due to missing task_struct declaration (diff)
parentMerge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 (diff)
downloadlinux-dev-6c9468e9eb1252eaefd94ce7f06e1be9b0b641b1.tar.xz
linux-dev-6c9468e9eb1252eaefd94ce7f06e1be9b0b641b1.zip
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index a1f7147b757f..c3bec024612e 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -20,6 +20,7 @@
#include <linux/blkdev.h>
#include <linux/seq_file.h>
+#include <linux/slab.h>
#include "md.h"
#include "raid0.h"
@@ -176,14 +177,15 @@ static int create_strip_zones(mddev_t *mddev)
disk_stack_limits(mddev->gendisk, rdev1->bdev,
rdev1->data_offset << 9);
/* as we don't honour merge_bvec_fn, we must never risk
- * violating it, so limit ->max_sector to one PAGE, as
- * a one page request is never in violation.
+ * violating it, so limit ->max_segments to 1, lying within
+ * a single page.
*/
- if (rdev1->bdev->bd_disk->queue->merge_bvec_fn &&
- queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9))
- blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9);
-
+ if (rdev1->bdev->bd_disk->queue->merge_bvec_fn) {
+ blk_queue_max_segments(mddev->queue, 1);
+ blk_queue_segment_boundary(mddev->queue,
+ PAGE_CACHE_SIZE - 1);
+ }
if (!smallest || (rdev1->sectors < smallest->sectors))
smallest = rdev1;
cnt++;