Files
kernel_arpi/include/linux
Eric Biggers aa132b78b3 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 <satyat@google.com>
Signed-off-by: Satya Tangirala <satyat@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220128233940.79464-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
2022-03-21 13:50:20 -07:00
..
2021-09-02 22:49:16 +02:00
2021-09-20 12:43:34 +01:00
2021-10-07 16:51:57 +02:00
2021-09-08 15:32:35 -07:00
2021-09-07 21:17:28 +02:00
2021-09-06 07:20:56 -04:00
2021-09-03 09:58:13 -07:00
2021-09-23 11:01:12 -04:00
2021-09-17 13:52:17 +01:00
2021-09-02 21:38:56 +02:00
2021-10-07 16:51:57 +02:00
2021-09-08 15:32:35 -07:00
2021-09-15 09:22:35 -06:00
2021-11-16 14:01:21 -08:00