diff options
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 42a480ba767b..55e7c56045a0 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3073,15 +3073,17 @@ static int raid5_congested(void *data, int bits) | |||
3073 | /* We want read requests to align with chunks where possible, | 3073 | /* We want read requests to align with chunks where possible, |
3074 | * but write requests don't need to. | 3074 | * but write requests don't need to. |
3075 | */ | 3075 | */ |
3076 | static int raid5_mergeable_bvec(struct request_queue *q, struct bio *bio, struct bio_vec *biovec) | 3076 | static int raid5_mergeable_bvec(struct request_queue *q, |
3077 | struct bvec_merge_data *bvm, | ||
3078 | struct bio_vec *biovec) | ||
3077 | { | 3079 | { |
3078 | mddev_t *mddev = q->queuedata; | 3080 | mddev_t *mddev = q->queuedata; |
3079 | sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev); | 3081 | sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev); |
3080 | int max; | 3082 | int max; |
3081 | unsigned int chunk_sectors = mddev->chunk_size >> 9; | 3083 | unsigned int chunk_sectors = mddev->chunk_size >> 9; |
3082 | unsigned int bio_sectors = bio->bi_size >> 9; | 3084 | unsigned int bio_sectors = bvm->bi_size >> 9; |
3083 | 3085 | ||
3084 | if (bio_data_dir(bio) == WRITE) | 3086 | if ((bvm->bi_rw & 1) == WRITE) |
3085 | return biovec->bv_len; /* always allow writes to be mergeable */ | 3087 | return biovec->bv_len; /* always allow writes to be mergeable */ |
3086 | 3088 | ||
3087 | max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9; | 3089 | max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9; |