diff options
| author | Eric Biggers <[email protected]> | 2022-01-28 23:39:36 +0000 |
|---|---|---|
| committer | Eric Biggers <[email protected]> | 2022-02-08 19:02:04 +0000 |
| commit | c6c89783eba05a5e159b07cfd8c68d841cc5de42 (patch) | |
| tree | d7915b13f5a4567d3b197b21d59966b3f430a0db /lib/mpi/mpi-bit.c | |
| parent | Linux 5.17-rc3 (diff) | |
| download | kernel-c6c89783eba05a5e159b07cfd8c68d841cc5de42.tar.gz kernel-c6c89783eba05a5e159b07cfd8c68d841cc5de42.zip | |
fscrypt: add functions for direct I/O support
Encrypted files traditionally haven't supported DIO, due to the need to
encrypt/decrypt the data. However, when the encryption is implemented
using inline encryption (blk-crypto) instead of the traditional
filesystem-layer encryption, it is straightforward to support DIO.
In preparation for supporting this, add the following functions:
- fscrypt_dio_supported() checks whether a DIO request is supported as
far as encryption is concerned. Encrypted files will only support DIO
when inline encryption is used and the I/O request is properly
aligned; this function checks these preconditions.
- fscrypt_limit_io_blocks() limits the length of a bio to avoid crossing
a place in the file that a bio with an encryption context cannot
cross due to a DUN discontiguity. This function is needed by
filesystems that use the iomap DIO implementation (which operates
directly on logical ranges, so it won't use fscrypt_mergeable_bio())
and that support FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32.
Co-developed-by: Satya Tangirala <[email protected]>
Signed-off-by: Satya Tangirala <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Eric Biggers <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-bit.c')
0 files changed, 0 insertions, 0 deletions
