mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-03-06 11:40:52 +00:00
dm crypt: tidy crypt_endio
Simplify crypt_endio function. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
This commit is contained in:
parent
5742fd7775
commit
ee7a491e62
@ -504,7 +504,7 @@ static void crypt_endio(struct bio *clone, int error)
|
|||||||
{
|
{
|
||||||
struct dm_crypt_io *io = clone->bi_private;
|
struct dm_crypt_io *io = clone->bi_private;
|
||||||
struct crypt_config *cc = io->target->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))
|
if (unlikely(!bio_flagged(clone, BIO_UPTODATE) && !error))
|
||||||
error = -EIO;
|
error = -EIO;
|
||||||
@ -512,21 +512,16 @@ static void crypt_endio(struct bio *clone, int error)
|
|||||||
/*
|
/*
|
||||||
* free the processed pages
|
* free the processed pages
|
||||||
*/
|
*/
|
||||||
if (!read_io) {
|
if (rw == WRITE)
|
||||||
crypt_free_buffer_pages(cc, clone);
|
crypt_free_buffer_pages(cc, clone);
|
||||||
goto out;
|
|
||||||
|
bio_put(clone);
|
||||||
|
|
||||||
|
if (rw == READ && !error) {
|
||||||
|
kcryptd_queue_crypt(io);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(error))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
bio_put(clone);
|
|
||||||
kcryptd_queue_crypt(io);
|
|
||||||
return;
|
|
||||||
|
|
||||||
out:
|
|
||||||
bio_put(clone);
|
|
||||||
|
|
||||||
if (unlikely(error))
|
if (unlikely(error))
|
||||||
io->error = error;
|
io->error = error;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user