diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-09-12 06:12:01 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-09-12 06:12:01 -0400 |
commit | 5a7bbad27a410350e64a2d7f5ec18fc73836c14f (patch) | |
tree | 3447cd62dbcbd77b4071e2eb7576f1d7632ef2d3 /drivers/block | |
parent | c20e8de27fef9f59869c81c288ad6cf28200e00c (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/block')
-rw-r--r-- | drivers/block/aoe/aoeblk.c | 14 | ||||
-rw-r--r-- | drivers/block/brd.c | 4 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_req.c | 8 | ||||
-rw-r--r-- | drivers/block/loop.c | 5 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 11 | ||||
-rw-r--r-- | drivers/block/ps3vram.c | 6 | ||||
-rw-r--r-- | drivers/block/umem.c | 4 |
8 files changed, 23 insertions, 31 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 528f6318ded1..167ba0af47f5 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -159,7 +159,7 @@ aoeblk_release(struct gendisk *disk, fmode_t mode) | |||
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
161 | 161 | ||
162 | static int | 162 | static void |
163 | aoeblk_make_request(struct request_queue *q, struct bio *bio) | 163 | aoeblk_make_request(struct request_queue *q, struct bio *bio) |
164 | { | 164 | { |
165 | struct sk_buff_head queue; | 165 | struct sk_buff_head queue; |
@@ -172,25 +172,25 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio) | |||
172 | if (bio == NULL) { | 172 | if (bio == NULL) { |
173 | printk(KERN_ERR "aoe: bio is NULL\n"); | 173 | printk(KERN_ERR "aoe: bio is NULL\n"); |
174 | BUG(); | 174 | BUG(); |
175 | return 0; | 175 | return; |
176 | } | 176 | } |
177 | d = bio->bi_bdev->bd_disk->private_data; | 177 | d = bio->bi_bdev->bd_disk->private_data; |
178 | if (d == NULL) { | 178 | if (d == NULL) { |
179 | printk(KERN_ERR "aoe: bd_disk->private_data is NULL\n"); | 179 | printk(KERN_ERR "aoe: bd_disk->private_data is NULL\n"); |
180 | BUG(); | 180 | BUG(); |
181 | bio_endio(bio, -ENXIO); | 181 | bio_endio(bio, -ENXIO); |
182 | return 0; | 182 | return; |
183 | } else if (bio->bi_io_vec == NULL) { | 183 | } else if (bio->bi_io_vec == NULL) { |
184 | printk(KERN_ERR "aoe: bi_io_vec is NULL\n"); | 184 | printk(KERN_ERR "aoe: bi_io_vec is NULL\n"); |
185 | BUG(); | 185 | BUG(); |
186 | bio_endio(bio, -ENXIO); | 186 | bio_endio(bio, -ENXIO); |
187 | return 0; | 187 | return; |
188 | } | 188 | } |
189 | buf = mempool_alloc(d->bufpool, GFP_NOIO); | 189 | buf = mempool_alloc(d->bufpool, GFP_NOIO); |
190 | if (buf == NULL) { | 190 | if (buf == NULL) { |
191 | printk(KERN_INFO "aoe: buf allocation failure\n"); | 191 | printk(KERN_INFO "aoe: buf allocation failure\n"); |
192 | bio_endio(bio, -ENOMEM); | 192 | bio_endio(bio, -ENOMEM); |
193 | return 0; | 193 | return; |
194 | } | 194 | } |
195 | memset(buf, 0, sizeof(*buf)); | 195 | memset(buf, 0, sizeof(*buf)); |
196 | INIT_LIST_HEAD(&buf->bufs); | 196 | INIT_LIST_HEAD(&buf->bufs); |
@@ -211,7 +211,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio) | |||
211 | spin_unlock_irqrestore(&d->lock, flags); | 211 | spin_unlock_irqrestore(&d->lock, flags); |
212 | mempool_free(buf, d->bufpool); | 212 | mempool_free(buf, d->bufpool); |
213 | bio_endio(bio, -ENXIO); | 213 | bio_endio(bio, -ENXIO); |
214 | return 0; | 214 | return; |
215 | } | 215 | } |
216 | 216 | ||
217 | list_add_tail(&buf->bufs, &d->bufq); | 217 | list_add_tail(&buf->bufs, &d->bufq); |
@@ -222,8 +222,6 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio) | |||
222 | 222 | ||
223 | spin_unlock_irqrestore(&d->lock, flags); | 223 | spin_unlock_irqrestore(&d->lock, flags); |
224 | aoenet_xmit(&queue); | 224 | aoenet_xmit(&queue); |
225 | |||
226 | return 0; | ||
227 | } | 225 | } |
228 | 226 | ||
229 | static int | 227 | static int |
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index dba1c32e1ddf..d22119d49e53 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c | |||
@@ -323,7 +323,7 @@ out: | |||
323 | return err; | 323 | return err; |
324 | } | 324 | } |
325 | 325 | ||
326 | static int brd_make_request(struct request_queue *q, struct bio *bio) | 326 | static void brd_make_request(struct request_queue *q, struct bio *bio) |
327 | { | 327 | { |
328 | struct block_device *bdev = bio->bi_bdev; | 328 | struct block_device *bdev = bio->bi_bdev; |
329 | struct brd_device *brd = bdev->bd_disk->private_data; | 329 | struct brd_device *brd = bdev->bd_disk->private_data; |
@@ -359,8 +359,6 @@ static int brd_make_request(struct request_queue *q, struct bio *bio) | |||
359 | 359 | ||
360 | out: | 360 | out: |
361 | bio_endio(bio, err); | 361 | bio_endio(bio, err); |
362 | |||
363 | return 0; | ||
364 | } | 362 | } |
365 | 363 | ||
366 | #ifdef CONFIG_BLK_DEV_XIP | 364 | #ifdef CONFIG_BLK_DEV_XIP |
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index ef2ceed3be4b..36eee3969a98 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -1507,7 +1507,7 @@ extern void drbd_free_mdev(struct drbd_conf *mdev); | |||
1507 | extern int proc_details; | 1507 | extern int proc_details; |
1508 | 1508 | ||
1509 | /* drbd_req */ | 1509 | /* drbd_req */ |
1510 | extern int drbd_make_request(struct request_queue *q, struct bio *bio); | 1510 | extern void drbd_make_request(struct request_queue *q, struct bio *bio); |
1511 | extern int drbd_read_remote(struct drbd_conf *mdev, struct drbd_request *req); | 1511 | extern int drbd_read_remote(struct drbd_conf *mdev, struct drbd_request *req); |
1512 | extern int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec); | 1512 | extern int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec); |
1513 | extern int is_valid_ar_handle(struct drbd_request *, sector_t); | 1513 | extern int is_valid_ar_handle(struct drbd_request *, sector_t); |
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 3424d675b769..4a0f314086e5 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -1073,7 +1073,7 @@ static int drbd_fail_request_early(struct drbd_conf *mdev, int is_write) | |||
1073 | return 0; | 1073 | return 0; |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | int drbd_make_request(struct request_queue *q, struct bio *bio) | 1076 | void drbd_make_request(struct request_queue *q, struct bio *bio) |
1077 | { | 1077 | { |
1078 | unsigned int s_enr, e_enr; | 1078 | unsigned int s_enr, e_enr; |
1079 | struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata; | 1079 | struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata; |
@@ -1081,7 +1081,7 @@ int drbd_make_request(struct request_queue *q, struct bio *bio) | |||
1081 | 1081 | ||
1082 | if (drbd_fail_request_early(mdev, bio_data_dir(bio) & WRITE)) { | 1082 | if (drbd_fail_request_early(mdev, bio_data_dir(bio) & WRITE)) { |
1083 | bio_endio(bio, -EPERM); | 1083 | bio_endio(bio, -EPERM); |
1084 | return 0; | 1084 | return; |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | start_time = jiffies; | 1087 | start_time = jiffies; |
@@ -1100,7 +1100,8 @@ int drbd_make_request(struct request_queue *q, struct bio *bio) | |||
1100 | 1100 | ||
1101 | if (likely(s_enr == e_enr)) { | 1101 | if (likely(s_enr == e_enr)) { |
1102 | inc_ap_bio(mdev, 1); | 1102 | inc_ap_bio(mdev, 1); |
1103 | return drbd_make_request_common(mdev, bio, start_time); | 1103 | drbd_make_request_common(mdev, bio, start_time); |
1104 | return; | ||
1104 | } | 1105 | } |
1105 | 1106 | ||
1106 | /* can this bio be split generically? | 1107 | /* can this bio be split generically? |
@@ -1148,7 +1149,6 @@ int drbd_make_request(struct request_queue *q, struct bio *bio) | |||
1148 | 1149 | ||
1149 | bio_pair_release(bp); | 1150 | bio_pair_release(bp); |
1150 | } | 1151 | } |
1151 | return 0; | ||
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | /* This is called by bio_add_page(). With this function we reduce | 1154 | /* This is called by bio_add_page(). With this function we reduce |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 76c8da78212b..8360239d553c 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -514,7 +514,7 @@ static struct bio *loop_get_bio(struct loop_device *lo) | |||
514 | return bio_list_pop(&lo->lo_bio_list); | 514 | return bio_list_pop(&lo->lo_bio_list); |
515 | } | 515 | } |
516 | 516 | ||
517 | static int loop_make_request(struct request_queue *q, struct bio *old_bio) | 517 | static void loop_make_request(struct request_queue *q, struct bio *old_bio) |
518 | { | 518 | { |
519 | struct loop_device *lo = q->queuedata; | 519 | struct loop_device *lo = q->queuedata; |
520 | int rw = bio_rw(old_bio); | 520 | int rw = bio_rw(old_bio); |
@@ -532,12 +532,11 @@ static int loop_make_request(struct request_queue *q, struct bio *old_bio) | |||
532 | loop_add_bio(lo, old_bio); | 532 | loop_add_bio(lo, old_bio); |
533 | wake_up(&lo->lo_event); | 533 | wake_up(&lo->lo_event); |
534 | spin_unlock_irq(&lo->lo_lock); | 534 | spin_unlock_irq(&lo->lo_lock); |
535 | return 0; | 535 | return; |
536 | 536 | ||
537 | out: | 537 | out: |
538 | spin_unlock_irq(&lo->lo_lock); | 538 | spin_unlock_irq(&lo->lo_lock); |
539 | bio_io_error(old_bio); | 539 | bio_io_error(old_bio); |
540 | return 0; | ||
541 | } | 540 | } |
542 | 541 | ||
543 | struct switch_request { | 542 | struct switch_request { |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index e133f094ab08..a63b0a2b7805 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2444,7 +2444,7 @@ static void pkt_end_io_read_cloned(struct bio *bio, int err) | |||
2444 | pkt_bio_finished(pd); | 2444 | pkt_bio_finished(pd); |
2445 | } | 2445 | } |
2446 | 2446 | ||
2447 | static int pkt_make_request(struct request_queue *q, struct bio *bio) | 2447 | static void pkt_make_request(struct request_queue *q, struct bio *bio) |
2448 | { | 2448 | { |
2449 | struct pktcdvd_device *pd; | 2449 | struct pktcdvd_device *pd; |
2450 | char b[BDEVNAME_SIZE]; | 2450 | char b[BDEVNAME_SIZE]; |
@@ -2473,7 +2473,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2473 | cloned_bio->bi_end_io = pkt_end_io_read_cloned; | 2473 | cloned_bio->bi_end_io = pkt_end_io_read_cloned; |
2474 | pd->stats.secs_r += bio->bi_size >> 9; | 2474 | pd->stats.secs_r += bio->bi_size >> 9; |
2475 | pkt_queue_bio(pd, cloned_bio); | 2475 | pkt_queue_bio(pd, cloned_bio); |
2476 | return 0; | 2476 | return; |
2477 | } | 2477 | } |
2478 | 2478 | ||
2479 | if (!test_bit(PACKET_WRITABLE, &pd->flags)) { | 2479 | if (!test_bit(PACKET_WRITABLE, &pd->flags)) { |
@@ -2509,7 +2509,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2509 | pkt_make_request(q, &bp->bio1); | 2509 | pkt_make_request(q, &bp->bio1); |
2510 | pkt_make_request(q, &bp->bio2); | 2510 | pkt_make_request(q, &bp->bio2); |
2511 | bio_pair_release(bp); | 2511 | bio_pair_release(bp); |
2512 | return 0; | 2512 | return; |
2513 | } | 2513 | } |
2514 | } | 2514 | } |
2515 | 2515 | ||
@@ -2533,7 +2533,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2533 | } | 2533 | } |
2534 | spin_unlock(&pkt->lock); | 2534 | spin_unlock(&pkt->lock); |
2535 | spin_unlock(&pd->cdrw.active_list_lock); | 2535 | spin_unlock(&pd->cdrw.active_list_lock); |
2536 | return 0; | 2536 | return; |
2537 | } else { | 2537 | } else { |
2538 | blocked_bio = 1; | 2538 | blocked_bio = 1; |
2539 | } | 2539 | } |
@@ -2584,10 +2584,9 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2584 | */ | 2584 | */ |
2585 | wake_up(&pd->wqueue); | 2585 | wake_up(&pd->wqueue); |
2586 | } | 2586 | } |
2587 | return 0; | 2587 | return; |
2588 | end_io: | 2588 | end_io: |
2589 | bio_io_error(bio); | 2589 | bio_io_error(bio); |
2590 | return 0; | ||
2591 | } | 2590 | } |
2592 | 2591 | ||
2593 | 2592 | ||
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c index b3bdb8af89cf..7fad7af87eb2 100644 --- a/drivers/block/ps3vram.c +++ b/drivers/block/ps3vram.c | |||
@@ -596,7 +596,7 @@ out: | |||
596 | return next; | 596 | return next; |
597 | } | 597 | } |
598 | 598 | ||
599 | static int ps3vram_make_request(struct request_queue *q, struct bio *bio) | 599 | static void ps3vram_make_request(struct request_queue *q, struct bio *bio) |
600 | { | 600 | { |
601 | struct ps3_system_bus_device *dev = q->queuedata; | 601 | struct ps3_system_bus_device *dev = q->queuedata; |
602 | struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); | 602 | struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); |
@@ -610,13 +610,11 @@ static int ps3vram_make_request(struct request_queue *q, struct bio *bio) | |||
610 | spin_unlock_irq(&priv->lock); | 610 | spin_unlock_irq(&priv->lock); |
611 | 611 | ||
612 | if (busy) | 612 | if (busy) |
613 | return 0; | 613 | return; |
614 | 614 | ||
615 | do { | 615 | do { |
616 | bio = ps3vram_do_bio(dev, bio); | 616 | bio = ps3vram_do_bio(dev, bio); |
617 | } while (bio); | 617 | } while (bio); |
618 | |||
619 | return 0; | ||
620 | } | 618 | } |
621 | 619 | ||
622 | static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) | 620 | static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) |
diff --git a/drivers/block/umem.c b/drivers/block/umem.c index 031ca720d926..aa2712060bfb 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c | |||
@@ -513,7 +513,7 @@ static void process_page(unsigned long data) | |||
513 | } | 513 | } |
514 | } | 514 | } |
515 | 515 | ||
516 | static int mm_make_request(struct request_queue *q, struct bio *bio) | 516 | static void mm_make_request(struct request_queue *q, struct bio *bio) |
517 | { | 517 | { |
518 | struct cardinfo *card = q->queuedata; | 518 | struct cardinfo *card = q->queuedata; |
519 | pr_debug("mm_make_request %llu %u\n", | 519 | pr_debug("mm_make_request %llu %u\n", |
@@ -525,7 +525,7 @@ static int mm_make_request(struct request_queue *q, struct bio *bio) | |||
525 | card->biotail = &bio->bi_next; | 525 | card->biotail = &bio->bi_next; |
526 | spin_unlock_irq(&card->lock); | 526 | spin_unlock_irq(&card->lock); |
527 | 527 | ||
528 | return 0; | 528 | return; |
529 | } | 529 | } |
530 | 530 | ||
531 | static irqreturn_t mm_interrupt(int irq, void *__card) | 531 | static irqreturn_t mm_interrupt(int irq, void *__card) |