dm crypt: use per-bio data
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 28 Mar 2014 19:51:55 +0000 (15:51 -0400)
committerAlex Shi <alex.shi@linaro.org>
Tue, 23 Jun 2015 07:28:33 +0000 (15:28 +0800)
commit3ae0c24e1ef998974256a8bd37a6b17d2a8ddc93
tree4b7b072562b103f36f905bb094efb73f00074d24
parentb5bd4625af0290d6e0cc7f7c73a4fadd59c4de01
dm crypt: use per-bio data

Change dm-crypt so that it uses auxiliary data allocated with the bio.

Dm-crypt requires two allocations per request - struct dm_crypt_io and
struct ablkcipher_request (with other data appended to it).  It
previously only used mempool allocations.

Some requests may require more dm_crypt_ios and ablkcipher_requests,
however most requests need just one of each of these two structures to
complete.

This patch changes it so that the first dm_crypt_io and ablkcipher_request
are allocated with the bio (using target per_bio_data_size option).  If
the request needs additional values, they are allocated from the mempool.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
(cherry picked from commit 298a9fa08a1577211d42a75e8fc073baef61e0d9)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
 Conflicts:
drivers/md/dm-crypt.c
 Solutions:
reuse the old bio->sector instead of bvec ioterator
drivers/md/dm-crypt.c