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 54c8ee28fcc4..9b00675dc64f 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3319,15 +3319,17 @@ static int raid5_congested(void *data, int bits)
3319/* We want read requests to align with chunks where possible, 3319/* We want read requests to align with chunks where possible,
3320 * but write requests don't need to. 3320 * but write requests don't need to.
3321 */ 3321 */
3322static int raid5_mergeable_bvec(struct request_queue *q, struct bio *bio, struct bio_vec *biovec) 3322static int raid5_mergeable_bvec(struct request_queue *q,
3323 struct bvec_merge_data *bvm,
3324 struct bio_vec *biovec)
3323{ 3325{
3324 mddev_t *mddev = q->queuedata; 3326 mddev_t *mddev = q->queuedata;
3325 sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev); 3327 sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
3326 int max; 3328 int max;
3327 unsigned int chunk_sectors = mddev->chunk_size >> 9; 3329 unsigned int chunk_sectors = mddev->chunk_size >> 9;
3328 unsigned int bio_sectors = bio->bi_size >> 9; 3330 unsigned int bio_sectors = bvm->bi_size >> 9;
3329 3331
3330 if (bio_data_dir(bio) == WRITE) 3332 if ((bvm->bi_rw & 1) == WRITE)
3331 return biovec->bv_len; /* always allow writes to be mergeable */ 3333 return biovec->bv_len; /* always allow writes to be mergeable */
3332 3334
3333 max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9; 3335 max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9;