dm crypt: don't allocate pages for a partial request
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 28 Mar 2014 19:51:56 +0000 (15:51 -0400)
committerMike Snitzer <snitzer@redhat.com>
Tue, 15 Jul 2014 18:21:38 +0000 (14:21 -0400)
commit43ff679b96313b0addaaaa9196c002144f465900
tree1abd28614a832d0ae64a972d148e5b9c7c1e415b
parent2d27b9d89a4d17096c821ce13530fa88a7b19da5
dm crypt: don't allocate pages for a partial request

Change crypt_alloc_buffer so that it only ever allocates pages for a
full request.

This change is a prerequisite for the commit "dm crypt: offload writes
to thread".  Which implies this change is effectively required for the
upcoming cpu parallelization changes.

But this change simplifies the dm-crypt code at the expense of reduced
throughput in low memory conditions (where allocation for a partial
request is most useful).

This change also enables the removal of the io_pending refcount.

Note: the next commit ("dm-crypt: avoid deadlock in mempools") is needed
to fix a theoretical deadlock.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c