dm crypt: Enable zoned block device support
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 8 Jul 2020 09:28:08 +0000 (18:28 +0900)
committerMike Snitzer <snitzer@redhat.com>
Mon, 20 Jul 2020 15:17:45 +0000 (11:17 -0400)
commit8e225f04d2dd6c1ca1eaecd5b04eaa90284df507
treede2df7b622f560d5ae623ca06e3d1a01cf45e92d
parent39d42fa96ba1b7d2544db3f8ed5da8fb0d5cb877
dm crypt: Enable zoned block device support

Enable support for zoned block devices. This is done by:
1) implementing the target report_zones method.
2) adding the DM_TARGET_ZONED_HM flag to the target features.
3) setting DM_CRYPT_NO_WRITE_WORKQUEUE flag to avoid IO
   processing via workqueue.
4) Introducing inline write encryption completion to preserve write
   ordering.

The last point is implemented by introducing the internal flag
DM_CRYPT_WRITE_INLINE. When set, kcryptd_crypt_write_convert() always
waits inline for the completion of a write request encryption if the
request is not already completed once crypt_convert() returns.
Completion of write request encryption is signaled using the
restart completion by kcryptd_async_done(). This mechanism allows
using ciphers that have an asynchronous implementation, isolating
dm-crypt from any potential request completion reordering for these
ciphers.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-crypt.c