aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-09-12 06:12:01 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-09-12 06:12:01 -0400
commit5a7bbad27a410350e64a2d7f5ec18fc73836c14f (patch)
tree3447cd62dbcbd77b4071e2eb7576f1d7632ef2d3 /drivers/md/md.c
parentc20e8de27fef9f59869c81c288ad6cf28200e00c (diff)
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>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8e221a20f5d9..5c2178562c96 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -330,18 +330,17 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
330 * call has finished, the bio has been linked into some internal structure 330 * call has finished, the bio has been linked into some internal structure
331 * and so is visible to ->quiesce(), so we don't need the refcount any more. 331 * and so is visible to ->quiesce(), so we don't need the refcount any more.
332 */ 332 */
333static int md_make_request(struct request_queue *q, struct bio *bio) 333static void md_make_request(struct request_queue *q, struct bio *bio)
334{ 334{
335 const int rw = bio_data_dir(bio); 335 const int rw = bio_data_dir(bio);
336 mddev_t *mddev = q->queuedata; 336 mddev_t *mddev = q->queuedata;
337 int rv;
338 int cpu; 337 int cpu;
339 unsigned int sectors; 338 unsigned int sectors;
340 339
341 if (mddev == NULL || mddev->pers == NULL 340 if (mddev == NULL || mddev->pers == NULL
342 || !mddev->ready) { 341 || !mddev->ready) {
343 bio_io_error(bio); 342 bio_io_error(bio);
344 return 0; 343 return;
345 } 344 }
346 smp_rmb(); /* Ensure implications of 'active' are visible */ 345 smp_rmb(); /* Ensure implications of 'active' are visible */
347 rcu_read_lock(); 346 rcu_read_lock();
@@ -366,7 +365,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
366 * go away inside make_request 365 * go away inside make_request
367 */ 366 */
368 sectors = bio_sectors(bio); 367 sectors = bio_sectors(bio);
369 rv = mddev->pers->make_request(mddev, bio); 368 mddev->pers->make_request(mddev, bio);
370 369
371 cpu = part_stat_lock(); 370 cpu = part_stat_lock();
372 part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]); 371 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)
375 374
376 if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended) 375 if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended)
377 wake_up(&mddev->sb_wait); 376 wake_up(&mddev->sb_wait);
378
379 return rv;
380} 377}
381 378
382/* mddev_suspend makes sure no new requests are submitted 379/* mddev_suspend makes sure no new requests are submitted
@@ -475,8 +472,7 @@ static void md_submit_flush_data(struct work_struct *ws)
475 bio_endio(bio, 0); 472 bio_endio(bio, 0);
476 else { 473 else {
477 bio->bi_rw &= ~REQ_FLUSH; 474 bio->bi_rw &= ~REQ_FLUSH;
478 if (mddev->pers->make_request(mddev, bio)) 475 mddev->pers->make_request(mddev, bio);
479 generic_make_request(bio);
480 } 476 }
481 477
482 mddev->flush_bio = NULL; 478 mddev->flush_bio = NULL;