aboutsummaryrefslogtreecommitdiff
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-11 19:14:22 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-11 19:14:22 -0700
commit1ce48904285fe4b0298864f9153a8502ebeac35c (patch)
treeffe1e0c31cdea427b48ae4d4d59a96ff9d208f32 /drivers/md/dm-crypt.c
parent55982fd184a065b1c69279d29cbc01dbf424d2f4 (diff)
parent780513ecb80ea0934fc6833efc4f5ed9ab4ff9bb (diff)
Merge branch 'block-2.6.24' of git://git.kernel.dk/data/git/linux-2.6-block
* 'block-2.6.24' of git://git.kernel.dk/data/git/linux-2.6-block: (37 commits) [BLOCK] Fix failing compile with BLK_DEV_IO_TRACE=n compat_ioctl: move floppy handlers to block/compat_ioctl.c compat_ioctl: move cdrom handlers to block/compat_ioctl.c compat_ioctl: move BLKPG handling to block/compat_ioctl.c compat_ioctl: move hdio calls to block/compat_ioctl.c compat_ioctl: handle blk_trace ioctls compat_ioctl: add compat_blkdev_driver_ioctl() compat_ioctl: move common block ioctls to compat_blkdev_ioctl Sysace: Don't enable IRQ until after interrupt handler is registered Sysace: sparse fixes Sysace: Minor coding convention fixup drivers/block/umem: use DRIVER_NAME where appropriate drivers/block/umem: trim trailing whitespace drivers/block/umem: minor cleanups drivers/block/umem: use dev_printk() drivers/block/umem: move private include away from include/linux Sysace: Labels in C code should not be indented. Sysace: Add of_platform_bus binding Sysace: Move IRQ handler registration to occur after FSM is initialized Sysace: minor rework and cleanup changes ...
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index bdc52d6922b..8216a6f75be 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -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)