block: Inline encryption support for blk-mq
We must have some way of letting a storage device driver know what encryption context it should use for en/decrypting a request. However, it's the upper layers (like the filesystem/fscrypt) that know about and manages encryption contexts. As such, when the upper layer submits a bio to the block layer, and this bio eventually reaches a device driver with support for inline encryption, the device driver will need to have been told the encryption context for that bio. We want to communicate the encryption context from the upper layer to the storage device along with the bio, when the bio is submitted to the block layer. To do this, we add a struct bio_crypt_ctx to struct bio, which can represent an encryption context (note that we can't use the bi_private field in struct bio to do this because that field does not function to pass information across layers in the storage stack). We also introduce various functions to manipulate the bio_crypt_ctx and make the bio/re...
Showing
- block/Makefile 1 addition, 1 deletionblock/Makefile
- block/bio.c 6 additions, 0 deletionsblock/bio.c
- block/blk-core.c 21 additions, 6 deletionsblock/blk-core.c
- block/blk-crypto-internal.h 166 additions, 0 deletionsblock/blk-crypto-internal.h
- block/blk-crypto.c 376 additions, 0 deletionsblock/blk-crypto.c
- block/blk-map.c 1 addition, 0 deletionsblock/blk-map.c
- block/blk-merge.c 11 additions, 0 deletionsblock/blk-merge.c
- block/blk-mq.c 13 additions, 0 deletionsblock/blk-mq.c
- block/blk.h 2 additions, 0 deletionsblock/blk.h
- block/bounce.c 2 additions, 0 deletionsblock/bounce.c
- drivers/md/dm.c 3 additions, 0 deletionsdrivers/md/dm.c
- include/linux/blk-crypto.h 71 additions, 0 deletionsinclude/linux/blk-crypto.h
- include/linux/blk_types.h 6 additions, 0 deletionsinclude/linux/blk_types.h
- include/linux/blkdev.h 5 additions, 0 deletionsinclude/linux/blkdev.h
Please register or sign in to comment