linux/fs/f2fs
Eric Biggers 8a2c77bc2a f2fs: support direct I/O with fscrypt using blk-crypto
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.

Therefore, make f2fs support DIO on files that are using inline
encryption.  Since f2fs uses iomap for DIO, and fscrypt support was
already added to iomap DIO, this just requires two small changes:

- Let DIO proceed when supported, by checking fscrypt_dio_supported()
  instead of assuming that encrypted files never support DIO.

- In f2fs_iomap_begin(), use fscrypt_limit_io_blocks() to limit the
  length of the mapping in the rare case where a DUN discontiguity
  occurs in the middle of an extent.  The iomap DIO implementation
  requires this, since it assumes that it can submit a bio covering (up
  to) the whole mapping, without checking fscrypt constraints itself.

Co-developed-by: Satya Tangirala <satyat@google.com>
Signed-off-by: Satya Tangirala <satyat@google.com>
Acked-by: Jaegeuk Kim <jaegeuk@kernel.org>
Link: https://lore.kernel.org/r/20220128233940.79464-5-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
2022-02-08 11:02:16 -08:00
..
acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
checkpoint.c f2fs: fix to check available space of CP area correctly in update_ckpt_flags() 2022-01-04 13:20:56 -08:00
compress.c f2fs: do not bother checkpoint by f2fs_get_node_info 2022-01-04 13:20:49 -08:00
data.c f2fs: support direct I/O with fscrypt using blk-crypto 2022-02-08 11:02:16 -08:00
debug.c f2fs: convert S_IRUGO to 0444 2021-08-17 11:59:05 -07:00
dir.c unicode: clean up the Kconfig symbol confusion 2022-01-20 19:57:24 -05:00
extent_cache.c f2fs: support fault injection for f2fs_kmem_cache_alloc() 2021-08-17 11:59:05 -07:00
f2fs.h f2fs: support direct I/O with fscrypt using blk-crypto 2022-02-08 11:02:16 -08:00
file.c f2fs: do not allow partial truncation on pinned file 2022-01-10 09:05:09 -08:00
gc.c f2fs-for-5.17-rc1 2022-01-19 11:50:20 +02:00
gc.h f2fs: introduce gc_merge mount option 2021-03-30 18:48:56 -07:00
hash.c unicode: clean up the Kconfig symbol confusion 2022-01-20 19:57:24 -05:00
inline.c f2fs: do not bother checkpoint by f2fs_get_node_info 2022-01-04 13:20:49 -08:00
inode.c f2fs-for-5.17-rc1 2022-01-19 11:50:20 +02:00
iostat.c f2fs: use iomap for direct I/O 2021-12-10 15:48:30 -08:00
iostat.h f2fs: introduce periodic iostat io latency traces 2021-08-23 10:25:51 -07:00
Kconfig f2fs: implement iomap operations 2021-12-04 10:53:35 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c unicode: clean up the Kconfig symbol confusion 2022-01-20 19:57:24 -05:00
node.c f2fs-for-5.17-rc1 2022-01-19 11:50:20 +02:00
node.h f2fs: introduce excess_dirty_threshold() 2021-09-20 16:12:51 -07:00
recovery.c Fix from Christoph Hellwig merging the CONFIG_UNICODE_UTF8_DATA into the 2022-02-01 11:13:24 -08:00
segment.c bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
segment.h f2fs: fix to reserve space for IO align feature 2022-01-04 13:20:56 -08:00
shrinker.c f2fs: avoid race condition for shrinker count 2020-12-03 00:59:26 -08:00
super.c Fix from Christoph Hellwig merging the CONFIG_UNICODE_UTF8_DATA into the 2022-02-01 11:13:24 -08:00
sysfs.c Fix from Christoph Hellwig merging the CONFIG_UNICODE_UTF8_DATA into the 2022-02-01 11:13:24 -08:00
verity.c f2fs: support fault injection for dquot_initialize() 2021-10-29 10:38:53 -07:00
xattr.c f2fs: clean up __find_inline_xattr() with __find_xattr() 2022-01-04 13:20:56 -08:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00