[dm-devel] [PATCH 08/20] dm-crypt: simplify io queue

Mikulas Patocka mpatocka at redhat.com
Tue Aug 21 09:09:19 UTC 2012


Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
---
 drivers/md/dm-crypt.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 4fd0d4b..967d218 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1084,13 +1084,7 @@ static void kcryptd_io(struct work_struct *work)
 {
 	struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work);
 
-	if (bio_data_dir(io->base_bio) == READ) {
-		crypt_inc_pending(io);
-		if (kcryptd_io_read(io, GFP_NOIO))
-			io->error = -ENOMEM;
-		crypt_dec_pending(io);
-	} else
-		kcryptd_io_write(io);
+	kcryptd_io_write(io);
 }
 
 static void kcryptd_queue_io(struct dm_crypt_io *io)
@@ -1846,8 +1840,7 @@ static int crypt_map(struct dm_target *ti, struct bio *bio,
 	io = crypt_io_alloc(cc, bio, dm_target_offset(ti, bio->bi_sector));
 
 	if (bio_data_dir(io->base_bio) == READ) {
-		if (kcryptd_io_read(io, GFP_NOWAIT))
-			kcryptd_queue_io(io);
+		kcryptd_io_read(io, GFP_NOIO);
 	} else {
 		kcryptd_crypt_write_convert(io);
 	}
-- 
1.7.10.4




More information about the dm-devel mailing list