aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 3b27df52456b..9ce7154845c6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3314,15 +3314,17 @@ static int raid5_congested(void *data, int bits)
3314/* We want read requests to align with chunks where possible, 3314/* We want read requests to align with chunks where possible,
3315 * but write requests don't need to. 3315 * but write requests don't need to.
3316 */ 3316 */
3317static int raid5_mergeable_bvec(struct request_queue *q, struct bio *bio, struct bio_vec *biovec) 3317static int raid5_mergeable_bvec(struct request_queue *q,
3318 struct bvec_merge_data *bvm,
3319 struct bio_vec *biovec)
3318{ 3320{
3319 mddev_t *mddev = q->queuedata; 3321 mddev_t *mddev = q->queuedata;
3320 sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev); 3322 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
3321 int max; 3323 int max;
3322 unsigned int chunk_sectors = mddev->chunk_size >> 9; 3324 unsigned int chunk_sectors = mddev->chunk_size >> 9;
3323 unsigned int bio_sectors = bio->bi_size >> 9; 3325 unsigned int bio_sectors = bvm->bi_size >> 9;
3324 3326
3325 if (bio_data_dir(bio) == WRITE) 3327 if ((bvm->bi_rw & 1) == WRITE)
3326 return biovec->bv_len; /* always allow writes to be mergeable */ 3328 return biovec->bv_len; /* always allow writes to be mergeable */
3327 3329
3328 max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9; 3330 max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9;