[dm-devel] [PATCH 07/20] dm-crypt: don't use write queue
Mikulas Patocka
mpatocka at redhat.com
Tue Aug 21 09:09:18 UTC 2012
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 <mpatocka at redhat.com>
---
drivers/md/dm-crypt.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index fd2909d..4fd0d4b 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1278,10 +1278,8 @@ static void kcryptd_crypt(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)
- 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)
@@ -1850,8 +1848,9 @@ static int crypt_map(struct dm_target *ti, struct bio *bio,
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;
}
--
1.7.10.4
More information about the dm-devel
mailing list