You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07: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 <neilb@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
+6
-19
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user