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:
NeilBrown
2007-09-27 12:47:43 +02:00
committed by Jens Axboe
parent 5bb23a688b
commit 6712ecf8f6
45 changed files with 132 additions and 328 deletions

View File

@@ -489,7 +489,7 @@ static void dec_pending(struct dm_crypt_io *io, int error)
if (!atomic_dec_and_test(&io->pending))
return;
bio_endio(io->base_bio, io->base_bio->bi_size, io->error);
bio_endio(io->base_bio, io->error);
mempool_free(io, cc->io_pool);
}
@@ -509,25 +509,19 @@ static void kcryptd_queue_io(struct dm_crypt_io *io)
queue_work(_kcryptd_workqueue, &io->work);
}
static int crypt_endio(struct bio *clone, unsigned int done, int error)
static void crypt_endio(struct bio *clone, int error)
{
struct dm_crypt_io *io = clone->bi_private;
struct crypt_config *cc = io->target->private;
unsigned read_io = bio_data_dir(clone) == READ;
/*
* free the processed pages, even if
* it's only a partially completed write
* free the processed pages
*/
if (!read_io)
crypt_free_buffer_pages(cc, clone, done);
/* keep going - not finished yet */
if (unlikely(clone->bi_size))
return 1;
if (!read_io)
if (!read_io) {
crypt_free_buffer_pages(cc, clone, clone->bi_size);
goto out;
}
if (unlikely(!bio_flagged(clone, BIO_UPTODATE))) {
error = -EIO;
@@ -537,12 +531,11 @@ static int crypt_endio(struct bio *clone, unsigned int done, int error)
bio_put(clone);
io->post_process = 1;
kcryptd_queue_io(io);
return 0;
return;
out:
bio_put(clone);
dec_pending(io, error);
return error;
}
static void clone_init(struct dm_crypt_io *io, struct bio *clone)