block: remove support for bio remapping from ->make_request
There is very little benefit in allowing to let a ->make_request instance update the bios device and sector and loop around it in __generic_make_request when we can archive the same through calling generic_make_request from the driver and letting the loop in generic_make_request handle it. Note that various drivers got the return value from ->make_request and returned non-zero values for errors. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:

committed by
Jens Axboe

parent
c20e8de27f
commit
5a7bbad27a
@@ -466,7 +466,7 @@ static inline int is_io_in_chunk_boundary(mddev_t *mddev,
|
||||
}
|
||||
}
|
||||
|
||||
static int raid0_make_request(mddev_t *mddev, struct bio *bio)
|
||||
static void raid0_make_request(mddev_t *mddev, struct bio *bio)
|
||||
{
|
||||
unsigned int chunk_sects;
|
||||
sector_t sector_offset;
|
||||
@@ -475,7 +475,7 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
|
||||
|
||||
if (unlikely(bio->bi_rw & REQ_FLUSH)) {
|
||||
md_flush_request(mddev, bio);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
chunk_sects = mddev->chunk_sectors;
|
||||
@@ -495,13 +495,10 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
|
||||
else
|
||||
bp = bio_split(bio, chunk_sects -
|
||||
sector_div(sector, chunk_sects));
|
||||
if (raid0_make_request(mddev, &bp->bio1))
|
||||
generic_make_request(&bp->bio1);
|
||||
if (raid0_make_request(mddev, &bp->bio2))
|
||||
generic_make_request(&bp->bio2);
|
||||
|
||||
raid0_make_request(mddev, &bp->bio1);
|
||||
raid0_make_request(mddev, &bp->bio2);
|
||||
bio_pair_release(bp);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
sector_offset = bio->bi_sector;
|
||||
@@ -511,10 +508,9 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
|
||||
bio->bi_bdev = tmp_dev->bdev;
|
||||
bio->bi_sector = sector_offset + zone->dev_start +
|
||||
tmp_dev->data_offset;
|
||||
/*
|
||||
* Let the main block layer submit the IO and resolve recursion:
|
||||
*/
|
||||
return 1;
|
||||
|
||||
generic_make_request(bio);
|
||||
return;
|
||||
|
||||
bad_map:
|
||||
printk("md/raid0:%s: make_request bug: can't convert block across chunks"
|
||||
@@ -523,7 +519,7 @@ bad_map:
|
||||
(unsigned long long)bio->bi_sector, bio->bi_size >> 10);
|
||||
|
||||
bio_io_error(bio);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static void raid0_status(struct seq_file *seq, mddev_t *mddev)
|
||||
|
Reference in New Issue
Block a user