|
@@ -439,26 +439,27 @@ static sector_t raid10_find_virt(conf_t *conf, sector_t sector, int dev)
|
|
|
/**
|
|
|
* raid10_mergeable_bvec -- tell bio layer if a two requests can be merged
|
|
|
* @q: request queue
|
|
|
- * @bio: the buffer head that's been built up so far
|
|
|
+ * @bvm: properties of new bio
|
|
|
* @biovec: the request that could be merged to it.
|
|
|
*
|
|
|
* Return amount of bytes we can accept at this offset
|
|
|
* If near_copies == raid_disk, there are no striping issues,
|
|
|
* but in that case, the function isn't called at all.
|
|
|
*/
|
|
|
-static int raid10_mergeable_bvec(struct request_queue *q, struct bio *bio,
|
|
|
- struct bio_vec *bio_vec)
|
|
|
+static int raid10_mergeable_bvec(struct request_queue *q,
|
|
|
+ struct bvec_merge_data *bvm,
|
|
|
+ struct bio_vec *biovec)
|
|
|
{
|
|
|
mddev_t *mddev = q->queuedata;
|
|
|
- sector_t sector = bio->bi_sector + get_start_sect(bio->bi_bdev);
|
|
|
+ sector_t sector = bvm->bi_sector + get_start_sect(bvm->bi_bdev);
|
|
|
int max;
|
|
|
unsigned int chunk_sectors = mddev->chunk_size >> 9;
|
|
|
- unsigned int bio_sectors = bio->bi_size >> 9;
|
|
|
+ unsigned int bio_sectors = bvm->bi_size >> 9;
|
|
|
|
|
|
max = (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9;
|
|
|
if (max < 0) max = 0; /* bio_add cannot handle a negative return */
|
|
|
- if (max <= bio_vec->bv_len && bio_sectors == 0)
|
|
|
- return bio_vec->bv_len;
|
|
|
+ if (max <= biovec->bv_len && bio_sectors == 0)
|
|
|
+ return biovec->bv_len;
|
|
|
else
|
|
|
return max;
|
|
|
}
|