diff options
author | NeilBrown <neilb@suse.de> | 2007-09-27 06:47:43 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:25:57 -0400 |
commit | 6712ecf8f648118c3363c142196418f89a510b90 (patch) | |
tree | 347d39a7d5a7ed96d3b1afecd28de2a0f98b98c9 /drivers/block/pktcdvd.c | |
parent | 5bb23a688b2de23d7765a1dd439d89c038378978 (diff) |
Drop 'size' argument from bio_endio and bi_end_io
As bi_end_io is only called once when the reqeust is complete,
the 'size' argument is now redundant. Remove it.
Now there is no need for bio_endio to subtract the size completed
from bi_size. So don't do that either.
While we are at it, change bi_end_io to return void.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index fadbfd880bab..540bf3676985 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1058,15 +1058,12 @@ static void pkt_make_local_copy(struct packet_data *pkt, struct bio_vec *bvec) | |||
1058 | } | 1058 | } |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | static int pkt_end_io_read(struct bio *bio, unsigned int bytes_done, int err) | 1061 | static void pkt_end_io_read(struct bio *bio, int err) |
1062 | { | 1062 | { |
1063 | struct packet_data *pkt = bio->bi_private; | 1063 | struct packet_data *pkt = bio->bi_private; |
1064 | struct pktcdvd_device *pd = pkt->pd; | 1064 | struct pktcdvd_device *pd = pkt->pd; |
1065 | BUG_ON(!pd); | 1065 | BUG_ON(!pd); |
1066 | 1066 | ||
1067 | if (bio->bi_size) | ||
1068 | return 1; | ||
1069 | |||
1070 | VPRINTK("pkt_end_io_read: bio=%p sec0=%llx sec=%llx err=%d\n", bio, | 1067 | VPRINTK("pkt_end_io_read: bio=%p sec0=%llx sec=%llx err=%d\n", bio, |
1071 | (unsigned long long)pkt->sector, (unsigned long long)bio->bi_sector, err); | 1068 | (unsigned long long)pkt->sector, (unsigned long long)bio->bi_sector, err); |
1072 | 1069 | ||
@@ -1077,19 +1074,14 @@ static int pkt_end_io_read(struct bio *bio, unsigned int bytes_done, int err) | |||
1077 | wake_up(&pd->wqueue); | 1074 | wake_up(&pd->wqueue); |
1078 | } | 1075 | } |
1079 | pkt_bio_finished(pd); | 1076 | pkt_bio_finished(pd); |
1080 | |||
1081 | return 0; | ||
1082 | } | 1077 | } |
1083 | 1078 | ||
1084 | static int pkt_end_io_packet_write(struct bio *bio, unsigned int bytes_done, int err) | 1079 | static void pkt_end_io_packet_write(struct bio *bio, int err) |
1085 | { | 1080 | { |
1086 | struct packet_data *pkt = bio->bi_private; | 1081 | struct packet_data *pkt = bio->bi_private; |
1087 | struct pktcdvd_device *pd = pkt->pd; | 1082 | struct pktcdvd_device *pd = pkt->pd; |
1088 | BUG_ON(!pd); | 1083 | BUG_ON(!pd); |
1089 | 1084 | ||
1090 | if (bio->bi_size) | ||
1091 | return 1; | ||
1092 | |||
1093 | VPRINTK("pkt_end_io_packet_write: id=%d, err=%d\n", pkt->id, err); | 1085 | VPRINTK("pkt_end_io_packet_write: id=%d, err=%d\n", pkt->id, err); |
1094 | 1086 | ||
1095 | pd->stats.pkt_ended++; | 1087 | pd->stats.pkt_ended++; |
@@ -1098,7 +1090,6 @@ static int pkt_end_io_packet_write(struct bio *bio, unsigned int bytes_done, int | |||
1098 | atomic_dec(&pkt->io_wait); | 1090 | atomic_dec(&pkt->io_wait); |
1099 | atomic_inc(&pkt->run_sm); | 1091 | atomic_inc(&pkt->run_sm); |
1100 | wake_up(&pd->wqueue); | 1092 | wake_up(&pd->wqueue); |
1101 | return 0; | ||
1102 | } | 1093 | } |
1103 | 1094 | ||
1104 | /* | 1095 | /* |
@@ -1470,7 +1461,7 @@ static void pkt_finish_packet(struct packet_data *pkt, int uptodate) | |||
1470 | while (bio) { | 1461 | while (bio) { |
1471 | next = bio->bi_next; | 1462 | next = bio->bi_next; |
1472 | bio->bi_next = NULL; | 1463 | bio->bi_next = NULL; |
1473 | bio_endio(bio, bio->bi_size, uptodate ? 0 : -EIO); | 1464 | bio_endio(bio, uptodate ? 0 : -EIO); |
1474 | bio = next; | 1465 | bio = next; |
1475 | } | 1466 | } |
1476 | pkt->orig_bios = pkt->orig_bios_tail = NULL; | 1467 | pkt->orig_bios = pkt->orig_bios_tail = NULL; |
@@ -2462,19 +2453,15 @@ static int pkt_close(struct inode *inode, struct file *file) | |||
2462 | } | 2453 | } |
2463 | 2454 | ||
2464 | 2455 | ||
2465 | static int pkt_end_io_read_cloned(struct bio *bio, unsigned int bytes_done, int err) | 2456 | static void pkt_end_io_read_cloned(struct bio *bio, int err) |
2466 | { | 2457 | { |
2467 | struct packet_stacked_data *psd = bio->bi_private; | 2458 | struct packet_stacked_data *psd = bio->bi_private; |
2468 | struct pktcdvd_device *pd = psd->pd; | 2459 | struct pktcdvd_device *pd = psd->pd; |
2469 | 2460 | ||
2470 | if (bio->bi_size) | ||
2471 | return 1; | ||
2472 | |||
2473 | bio_put(bio); | 2461 | bio_put(bio); |
2474 | bio_endio(psd->bio, psd->bio->bi_size, err); | 2462 | bio_endio(psd->bio, err); |
2475 | mempool_free(psd, psd_pool); | 2463 | mempool_free(psd, psd_pool); |
2476 | pkt_bio_finished(pd); | 2464 | pkt_bio_finished(pd); |
2477 | return 0; | ||
2478 | } | 2465 | } |
2479 | 2466 | ||
2480 | static int pkt_make_request(struct request_queue *q, struct bio *bio) | 2467 | static int pkt_make_request(struct request_queue *q, struct bio *bio) |
@@ -2620,7 +2607,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2620 | } | 2607 | } |
2621 | return 0; | 2608 | return 0; |
2622 | end_io: | 2609 | end_io: |
2623 | bio_io_error(bio, bio->bi_size); | 2610 | bio_io_error(bio); |
2624 | return 0; | 2611 | return 0; |
2625 | } | 2612 | } |
2626 | 2613 | ||