dm-crypt: don't use write queue Don't use write queue and allocate write data directly from the request routine. There is no need to bounce requests through a queue. Signed-off-by: Mikulas Patocka --- drivers/md/dm-crypt.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) Index: linux-3.2-fast/drivers/md/dm-crypt.c =================================================================== --- linux-3.2-fast.orig/drivers/md/dm-crypt.c 2012-02-18 17:05:49.000000000 +0100 +++ linux-3.2-fast/drivers/md/dm-crypt.c 2012-02-18 17:11:10.000000000 +0100 @@ -1280,10 +1280,8 @@ static void kcryptd_crypt(struct work_st { struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work); - if (bio_data_dir(io->base_bio) == READ) - kcryptd_crypt_read_convert(io); - else - kcryptd_crypt_write_convert(io); + BUG_ON(bio_data_dir(io->base_bio) != READ); + kcryptd_crypt_read_convert(io); } static void kcryptd_queue_crypt(struct dm_crypt_io *io) @@ -1855,8 +1853,9 @@ static int crypt_map(struct dm_target *t if (bio_data_dir(io->base_bio) == READ) { if (kcryptd_io_read(io, GFP_NOWAIT)) kcryptd_queue_io(io); - } else - kcryptd_queue_crypt(io); + } else { + kcryptd_crypt_write_convert(io); + } return DM_MAPIO_SUBMITTED; }