mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
5bb23a688b
commit
6712ecf8f6
45 changed files with 132 additions and 328 deletions
|
|
@ -138,7 +138,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
|
|||
buf = mempool_alloc(d->bufpool, GFP_NOIO);
|
||||
if (buf == NULL) {
|
||||
printk(KERN_INFO "aoe: buf allocation failure\n");
|
||||
bio_endio(bio, bio->bi_size, -ENOMEM);
|
||||
bio_endio(bio, -ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
memset(buf, 0, sizeof(*buf));
|
||||
|
|
@ -159,7 +159,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
|
|||
d->aoemajor, d->aoeminor);
|
||||
spin_unlock_irqrestore(&d->lock, flags);
|
||||
mempool_free(buf, d->bufpool);
|
||||
bio_endio(bio, bio->bi_size, -ENXIO);
|
||||
bio_endio(bio, -ENXIO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -652,7 +652,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
|
|||
disk_stat_add(disk, sectors[rw], n_sect);
|
||||
disk_stat_add(disk, io_ticks, duration);
|
||||
n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
|
||||
bio_endio(buf->bio, buf->bio->bi_size, n);
|
||||
bio_endio(buf->bio, n);
|
||||
mempool_free(buf, d->bufpool);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ aoedev_downdev(struct aoedev *d)
|
|||
bio = buf->bio;
|
||||
if (--buf->nframesout == 0) {
|
||||
mempool_free(buf, d->bufpool);
|
||||
bio_endio(bio, bio->bi_size, -EIO);
|
||||
bio_endio(bio, -EIO);
|
||||
}
|
||||
skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ aoedev_downdev(struct aoedev *d)
|
|||
list_del(d->bufq.next);
|
||||
bio = buf->bio;
|
||||
mempool_free(buf, d->bufpool);
|
||||
bio_endio(bio, bio->bi_size, -EIO);
|
||||
bio_endio(bio, -EIO);
|
||||
}
|
||||
|
||||
if (d->gd)
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,7 @@ static inline void complete_buffers(struct bio *bio, int status)
|
|||
int nr_sectors = bio_sectors(bio);
|
||||
|
||||
bio->bi_next = NULL;
|
||||
bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
|
||||
bio_endio(bio, status ? 0 : -EIO);
|
||||
bio = xbh;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -987,7 +987,7 @@ static inline void complete_buffers(struct bio *bio, int ok)
|
|||
xbh = bio->bi_next;
|
||||
bio->bi_next = NULL;
|
||||
|
||||
bio_endio(bio, nr_sectors << 9, ok ? 0 : -EIO);
|
||||
bio_endio(bio, ok ? 0 : -EIO);
|
||||
|
||||
bio = xbh;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3810,14 +3810,10 @@ static int check_floppy_change(struct gendisk *disk)
|
|||
* a disk in the drive, and whether that disk is writable.
|
||||
*/
|
||||
|
||||
static int floppy_rb0_complete(struct bio *bio, unsigned int bytes_done,
|
||||
static void floppy_rb0_complete(struct bio *bio,
|
||||
int err)
|
||||
{
|
||||
if (bio->bi_size)
|
||||
return 1;
|
||||
|
||||
complete((struct completion *)bio->bi_private);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __floppy_read_block_0(struct block_device *bdev)
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ static int loop_make_request(struct request_queue *q, struct bio *old_bio)
|
|||
|
||||
out:
|
||||
spin_unlock_irq(&lo->lo_lock);
|
||||
bio_io_error(old_bio, old_bio->bi_size);
|
||||
bio_io_error(old_bio);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ static inline void loop_handle_bio(struct loop_device *lo, struct bio *bio)
|
|||
bio_put(bio);
|
||||
} else {
|
||||
int ret = do_bio_filebacked(lo, bio);
|
||||
bio_endio(bio, bio->bi_size, ret);
|
||||
bio_endio(bio, ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1058,15 +1058,12 @@ static void pkt_make_local_copy(struct packet_data *pkt, struct bio_vec *bvec)
|
|||
}
|
||||
}
|
||||
|
||||
static int pkt_end_io_read(struct bio *bio, unsigned int bytes_done, int err)
|
||||
static void pkt_end_io_read(struct bio *bio, int err)
|
||||
{
|
||||
struct packet_data *pkt = bio->bi_private;
|
||||
struct pktcdvd_device *pd = pkt->pd;
|
||||
BUG_ON(!pd);
|
||||
|
||||
if (bio->bi_size)
|
||||
return 1;
|
||||
|
||||
VPRINTK("pkt_end_io_read: bio=%p sec0=%llx sec=%llx err=%d\n", bio,
|
||||
(unsigned long long)pkt->sector, (unsigned long long)bio->bi_sector, err);
|
||||
|
||||
|
|
@ -1077,19 +1074,14 @@ static int pkt_end_io_read(struct bio *bio, unsigned int bytes_done, int err)
|
|||
wake_up(&pd->wqueue);
|
||||
}
|
||||
pkt_bio_finished(pd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pkt_end_io_packet_write(struct bio *bio, unsigned int bytes_done, int err)
|
||||
static void pkt_end_io_packet_write(struct bio *bio, int err)
|
||||
{
|
||||
struct packet_data *pkt = bio->bi_private;
|
||||
struct pktcdvd_device *pd = pkt->pd;
|
||||
BUG_ON(!pd);
|
||||
|
||||
if (bio->bi_size)
|
||||
return 1;
|
||||
|
||||
VPRINTK("pkt_end_io_packet_write: id=%d, err=%d\n", pkt->id, err);
|
||||
|
||||
pd->stats.pkt_ended++;
|
||||
|
|
@ -1098,7 +1090,6 @@ static int pkt_end_io_packet_write(struct bio *bio, unsigned int bytes_done, int
|
|||
atomic_dec(&pkt->io_wait);
|
||||
atomic_inc(&pkt->run_sm);
|
||||
wake_up(&pd->wqueue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1470,7 +1461,7 @@ static void pkt_finish_packet(struct packet_data *pkt, int uptodate)
|
|||
while (bio) {
|
||||
next = bio->bi_next;
|
||||
bio->bi_next = NULL;
|
||||
bio_endio(bio, bio->bi_size, uptodate ? 0 : -EIO);
|
||||
bio_endio(bio, uptodate ? 0 : -EIO);
|
||||
bio = next;
|
||||
}
|
||||
pkt->orig_bios = pkt->orig_bios_tail = NULL;
|
||||
|
|
@ -2462,19 +2453,15 @@ static int pkt_close(struct inode *inode, struct file *file)
|
|||
}
|
||||
|
||||
|
||||
static int pkt_end_io_read_cloned(struct bio *bio, unsigned int bytes_done, int err)
|
||||
static void pkt_end_io_read_cloned(struct bio *bio, int err)
|
||||
{
|
||||
struct packet_stacked_data *psd = bio->bi_private;
|
||||
struct pktcdvd_device *pd = psd->pd;
|
||||
|
||||
if (bio->bi_size)
|
||||
return 1;
|
||||
|
||||
bio_put(bio);
|
||||
bio_endio(psd->bio, psd->bio->bi_size, err);
|
||||
bio_endio(psd->bio, err);
|
||||
mempool_free(psd, psd_pool);
|
||||
pkt_bio_finished(pd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
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)
|
|||
}
|
||||
return 0;
|
||||
end_io:
|
||||
bio_io_error(bio, bio->bi_size);
|
||||
bio_io_error(bio);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,10 +287,10 @@ static int rd_make_request(struct request_queue *q, struct bio *bio)
|
|||
if (ret)
|
||||
goto fail;
|
||||
|
||||
bio_endio(bio, bio->bi_size, 0);
|
||||
bio_endio(bio, 0);
|
||||
return 0;
|
||||
fail:
|
||||
bio_io_error(bio, bio->bi_size);
|
||||
bio_io_error(bio);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ static void process_page(unsigned long data)
|
|||
|
||||
return_bio = bio->bi_next;
|
||||
bio->bi_next = NULL;
|
||||
bio_endio(bio, bio->bi_size, 0);
|
||||
bio_endio(bio, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue