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:
@@ -484,23 +484,20 @@ static void dec_pending(struct dm_io *io, int error)
|
||||
blk_add_trace_bio(io->md->queue, io->bio,
|
||||
BLK_TA_COMPLETE);
|
||||
|
||||
bio_endio(io->bio, io->bio->bi_size, io->error);
|
||||
bio_endio(io->bio, io->error);
|
||||
}
|
||||
|
||||
free_io(io->md, io);
|
||||
}
|
||||
}
|
||||
|
||||
static int clone_endio(struct bio *bio, unsigned int done, int error)
|
||||
static void clone_endio(struct bio *bio, int error)
|
||||
{
|
||||
int r = 0;
|
||||
struct dm_target_io *tio = bio->bi_private;
|
||||
struct mapped_device *md = tio->io->md;
|
||||
dm_endio_fn endio = tio->ti->type->end_io;
|
||||
|
||||
if (bio->bi_size)
|
||||
return 1;
|
||||
|
||||
if (!bio_flagged(bio, BIO_UPTODATE) && !error)
|
||||
error = -EIO;
|
||||
|
||||
@@ -514,7 +511,7 @@ static int clone_endio(struct bio *bio, unsigned int done, int error)
|
||||
error = r;
|
||||
else if (r == DM_ENDIO_INCOMPLETE)
|
||||
/* The target will handle the io */
|
||||
return 1;
|
||||
return;
|
||||
else if (r) {
|
||||
DMWARN("unimplemented target endio return value: %d", r);
|
||||
BUG();
|
||||
@@ -530,7 +527,6 @@ static int clone_endio(struct bio *bio, unsigned int done, int error)
|
||||
|
||||
bio_put(bio);
|
||||
free_tio(md, tio);
|
||||
return r;
|
||||
}
|
||||
|
||||
static sector_t max_io_len(struct mapped_device *md,
|
||||
@@ -761,7 +757,7 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
|
||||
|
||||
ci.map = dm_get_table(md);
|
||||
if (!ci.map) {
|
||||
bio_io_error(bio, bio->bi_size);
|
||||
bio_io_error(bio);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -803,7 +799,7 @@ static int dm_request(struct request_queue *q, struct bio *bio)
|
||||
* guarantee it is (or can be) handled by the targets correctly.
|
||||
*/
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -820,13 +816,13 @@ static int dm_request(struct request_queue *q, struct bio *bio)
|
||||
up_read(&md->io_lock);
|
||||
|
||||
if (bio_rw(bio) == READA) {
|
||||
bio_io_error(bio, bio->bi_size);
|
||||
bio_io_error(bio);
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = queue_io(md, bio);
|
||||
if (r < 0) {
|
||||
bio_io_error(bio, bio->bi_size);
|
||||
bio_io_error(bio);
|
||||
return 0;
|
||||
|
||||
} else if (r == 0)
|
||||
|
Reference in New Issue
Block a user