aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-09-27 06:47:43 -0400
committerJens Axboe <axboe@carl.home.kernel.dk>2007-10-10 03:25:57 -0400
commit6712ecf8f648118c3363c142196418f89a510b90 (patch)
tree347d39a7d5a7ed96d3b1afecd28de2a0f98b98c9 /drivers/block
parent5bb23a688b2de23d7765a1dd439d89c038378978 (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')
-rw-r--r--drivers/block/aoe/aoeblk.c4
-rw-r--r--drivers/block/aoe/aoecmd.c2
-rw-r--r--drivers/block/aoe/aoedev.c4
-rw-r--r--drivers/block/cciss.c2
-rw-r--r--drivers/block/cpqarray.c2
-rw-r--r--drivers/block/floppy.c6
-rw-r--r--drivers/block/loop.c4
-rw-r--r--drivers/block/pktcdvd.c25
-rw-r--r--drivers/block/rd.c4
-rw-r--r--drivers/block/umem.c2
10 files changed, 19 insertions, 36 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 007faaf008e7..b1d00ef6659c 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -138,7 +138,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
138 buf = mempool_alloc(d->bufpool, GFP_NOIO); 138 buf = mempool_alloc(d->bufpool, GFP_NOIO);
139 if (buf == NULL) { 139 if (buf == NULL) {
140 printk(KERN_INFO "aoe: buf allocation failure\n"); 140 printk(KERN_INFO "aoe: buf allocation failure\n");
141 bio_endio(bio, bio->bi_size, -ENOMEM); 141 bio_endio(bio, -ENOMEM);
142 return 0; 142 return 0;
143 } 143 }
144 memset(buf, 0, sizeof(*buf)); 144 memset(buf, 0, sizeof(*buf));
@@ -159,7 +159,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
159 d->aoemajor, d->aoeminor); 159 d->aoemajor, d->aoeminor);
160 spin_unlock_irqrestore(&d->lock, flags); 160 spin_unlock_irqrestore(&d->lock, flags);
161 mempool_free(buf, d->bufpool); 161 mempool_free(buf, d->bufpool);
162 bio_endio(bio, bio->bi_size, -ENXIO); 162 bio_endio(bio, -ENXIO);
163 return 0; 163 return 0;
164 } 164 }
165 165
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 01fbdd38e3be..5abae34ad65b 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -652,7 +652,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
652 disk_stat_add(disk, sectors[rw], n_sect); 652 disk_stat_add(disk, sectors[rw], n_sect);
653 disk_stat_add(disk, io_ticks, duration); 653 disk_stat_add(disk, io_ticks, duration);
654 n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; 654 n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
655 bio_endio(buf->bio, buf->bio->bi_size, n); 655 bio_endio(buf->bio, n);
656 mempool_free(buf, d->bufpool); 656 mempool_free(buf, d->bufpool);
657 } 657 }
658 } 658 }
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 05a97197c918..51f50710e5fc 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -119,7 +119,7 @@ aoedev_downdev(struct aoedev *d)
119 bio = buf->bio; 119 bio = buf->bio;
120 if (--buf->nframesout == 0) { 120 if (--buf->nframesout == 0) {
121 mempool_free(buf, d->bufpool); 121 mempool_free(buf, d->bufpool);
122 bio_endio(bio, bio->bi_size, -EIO); 122 bio_endio(bio, -EIO);
123 } 123 }
124 skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0; 124 skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
125 } 125 }
@@ -130,7 +130,7 @@ aoedev_downdev(struct aoedev *d)
130 list_del(d->bufq.next); 130 list_del(d->bufq.next);
131 bio = buf->bio; 131 bio = buf->bio;
132 mempool_free(buf, d->bufpool); 132 mempool_free(buf, d->bufpool);
133 bio_endio(bio, bio->bi_size, -EIO); 133 bio_endio(bio, -EIO);
134 } 134 }
135 135
136 if (d->gd) 136 if (d->gd)
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 084358a828e9..28d145756f6c 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1194,7 +1194,7 @@ static inline void complete_buffers(struct bio *bio, int status)
1194 int nr_sectors = bio_sectors(bio); 1194 int nr_sectors = bio_sectors(bio);
1195 1195
1196 bio->bi_next = NULL; 1196 bio->bi_next = NULL;
1197 bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO); 1197 bio_endio(bio, status ? 0 : -EIO);
1198 bio = xbh; 1198 bio = xbh;
1199 } 1199 }
1200} 1200}
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index eb9799acf65b..3853c9a38d6a 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -987,7 +987,7 @@ static inline void complete_buffers(struct bio *bio, int ok)
987 xbh = bio->bi_next; 987 xbh = bio->bi_next;
988 bio->bi_next = NULL; 988 bio->bi_next = NULL;
989 989
990 bio_endio(bio, nr_sectors << 9, ok ? 0 : -EIO); 990 bio_endio(bio, ok ? 0 : -EIO);
991 991
992 bio = xbh; 992 bio = xbh;
993 } 993 }
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index f0a86e201b44..80483aac4cc9 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3810,14 +3810,10 @@ static int check_floppy_change(struct gendisk *disk)
3810 * a disk in the drive, and whether that disk is writable. 3810 * a disk in the drive, and whether that disk is writable.
3811 */ 3811 */
3812 3812
3813static int floppy_rb0_complete(struct bio *bio, unsigned int bytes_done, 3813static void floppy_rb0_complete(struct bio *bio,
3814 int err) 3814 int err)
3815{ 3815{
3816 if (bio->bi_size)
3817 return 1;
3818
3819 complete((struct completion *)bio->bi_private); 3816 complete((struct completion *)bio->bi_private);
3820 return 0;
3821} 3817}
3822 3818
3823static int __floppy_read_block_0(struct block_device *bdev) 3819static int __floppy_read_block_0(struct block_device *bdev)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 9f015fce4135..b9233a06934c 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -551,7 +551,7 @@ static int loop_make_request(struct request_queue *q, struct bio *old_bio)
551 551
552out: 552out:
553 spin_unlock_irq(&lo->lo_lock); 553 spin_unlock_irq(&lo->lo_lock);
554 bio_io_error(old_bio, old_bio->bi_size); 554 bio_io_error(old_bio);
555 return 0; 555 return 0;
556} 556}
557 557
@@ -580,7 +580,7 @@ static inline void loop_handle_bio(struct loop_device *lo, struct bio *bio)
580 bio_put(bio); 580 bio_put(bio);
581 } else { 581 } else {
582 int ret = do_bio_filebacked(lo, bio); 582 int ret = do_bio_filebacked(lo, bio);
583 bio_endio(bio, bio->bi_size, ret); 583 bio_endio(bio, ret);
584 } 584 }
585} 585}
586 586
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
1061static int pkt_end_io_read(struct bio *bio, unsigned int bytes_done, int err) 1061static 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
1084static int pkt_end_io_packet_write(struct bio *bio, unsigned int bytes_done, int err) 1079static 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
2465static int pkt_end_io_read_cloned(struct bio *bio, unsigned int bytes_done, int err) 2456static 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
2480static int pkt_make_request(struct request_queue *q, struct bio *bio) 2467static 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;
2622end_io: 2609end_io:
2623 bio_io_error(bio, bio->bi_size); 2610 bio_io_error(bio);
2624 return 0; 2611 return 0;
2625} 2612}
2626 2613
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 65150b548f3a..701ea77f62e9 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -287,10 +287,10 @@ static int rd_make_request(struct request_queue *q, struct bio *bio)
287 if (ret) 287 if (ret)
288 goto fail; 288 goto fail;
289 289
290 bio_endio(bio, bio->bi_size, 0); 290 bio_endio(bio, 0);
291 return 0; 291 return 0;
292fail: 292fail:
293 bio_io_error(bio, bio->bi_size); 293 bio_io_error(bio);
294 return 0; 294 return 0;
295} 295}
296 296
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index c378e285d708..be7fac86725e 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -545,7 +545,7 @@ static void process_page(unsigned long data)
545 545
546 return_bio = bio->bi_next; 546 return_bio = bio->bi_next;
547 bio->bi_next = NULL; 547 bio->bi_next = NULL;
548 bio_endio(bio, bio->bi_size, 0); 548 bio_endio(bio, 0);
549 } 549 }
550} 550}
551 551