Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ee7a491e62214bfd56c97c1fef3672c09e2a700d
Commit:     ee7a491e62214bfd56c97c1fef3672c09e2a700d
Parent:     5742fd77757894ebb5e441afbdac1fb666e782f7
Author:     Milan Broz <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 02:10:46 2008 +0000
Committer:  Alasdair G Kergon <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 02:10:46 2008 +0000

    dm crypt: tidy crypt_endio
    
    Simplify crypt_endio function.
    
    Signed-off-by: Milan Broz <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
---
 drivers/md/dm-crypt.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index cc189a2..2786599 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -504,7 +504,7 @@ 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;
+       unsigned rw = bio_data_dir(clone);
 
        if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error))
                error = -EIO;
@@ -512,20 +512,15 @@ static void crypt_endio(struct bio *clone, int error)
        /*
         * free the processed pages
         */
-       if (!read_io) {
+       if (rw == WRITE)
                crypt_free_buffer_pages(cc, clone);
-               goto out;
-       }
-
-       if (unlikely(error))
-               goto out;
 
        bio_put(clone);
-       kcryptd_queue_crypt(io);
-       return;
 
-out:
-       bio_put(clone);
+       if (rw == READ && !error) {
+               kcryptd_queue_crypt(io);
+               return;
+       }
 
        if (unlikely(error))
                io->error = error;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to