fscrypt: support decrypting data from large folios
authorEric Biggers <ebiggers@google.com>
Fri, 27 Jan 2023 22:25:14 +0000 (14:25 -0800)
committerEric Biggers <ebiggers@google.com>
Sat, 28 Jan 2023 23:10:12 +0000 (15:10 -0800)
commit51e4e3153ebc32d3280d5d17418ae6f1a44f1ec1
tree55d0a9d3b02a0a403034e6130829e0901e6f93fa
parent5d0f0e57ed900917836385527ce5b122fa1425a3
fscrypt: support decrypting data from large folios

Try to make the filesystem-level decryption functions in fs/crypto/
aware of large folios.  This includes making fscrypt_decrypt_bio()
support the case where the bio contains large folios, and making
fscrypt_decrypt_pagecache_blocks() take a folio instead of a page.

There's no way to actually test this with large folios yet, but I've
tested that this doesn't cause any regressions.

Note that this patch just handles *decryption*, not encryption which
will be a little more difficult.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20230127224202.355629-1-ebiggers@kernel.org
Documentation/filesystems/fscrypt.rst
fs/buffer.c
fs/crypto/bio.c
fs/crypto/crypto.c
fs/ext4/inode.c
include/linux/fscrypt.h