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
@@ -330,18 +330,17 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
|
||||
* call has finished, the bio has been linked into some internal structure
|
||||
* and so is visible to ->quiesce(), so we don't need the refcount any more.
|
||||
*/
|
||||
static int md_make_request(struct request_queue *q, struct bio *bio)
|
||||
static void md_make_request(struct request_queue *q, struct bio *bio)
|
||||
{
|
||||
const int rw = bio_data_dir(bio);
|
||||
mddev_t *mddev = q->queuedata;
|
||||
int rv;
|
||||
int cpu;
|
||||
unsigned int sectors;
|
||||
|
||||
if (mddev == NULL || mddev->pers == NULL
|
||||
|| !mddev->ready) {
|
||||
bio_io_error(bio);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
smp_rmb(); /* Ensure implications of 'active' are visible */
|
||||
rcu_read_lock();
|
||||
@@ -366,7 +365,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
|
||||
* go away inside make_request
|
||||
*/
|
||||
sectors = bio_sectors(bio);
|
||||
rv = mddev->pers->make_request(mddev, bio);
|
||||
mddev->pers->make_request(mddev, bio);
|
||||
|
||||
cpu = part_stat_lock();
|
||||
part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
|
||||
@@ -375,8 +374,6 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
|
||||
|
||||
if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended)
|
||||
wake_up(&mddev->sb_wait);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* mddev_suspend makes sure no new requests are submitted
|
||||
@@ -475,8 +472,7 @@ static void md_submit_flush_data(struct work_struct *ws)
|
||||
bio_endio(bio, 0);
|
||||
else {
|
||||
bio->bi_rw &= ~REQ_FLUSH;
|
||||
if (mddev->pers->make_request(mddev, bio))
|
||||
generic_make_request(bio);
|
||||
mddev->pers->make_request(mddev, bio);
|
||||
}
|
||||
|
||||
mddev->flush_bio = NULL;
|
||||
|
Reference in New Issue
Block a user