diff options
author | Eric Biggers <ebiggers@google.com> | 2023-01-28 01:25:14 +0300 |
---|---|---|
committer | Eric Biggers <ebiggers@google.com> | 2023-01-29 02:10:12 +0300 |
commit | 51e4e3153ebc32d3280d5d17418ae6f1a44f1ec1 (patch) | |
tree | 55d0a9d3b02a0a403034e6130829e0901e6f93fa /include/linux/fscrypt.h | |
parent | 5d0f0e57ed900917836385527ce5b122fa1425a3 (diff) | |
download | linux-51e4e3153ebc32d3280d5d17418ae6f1a44f1ec1.tar.xz |
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
Diffstat (limited to 'include/linux/fscrypt.h')
-rw-r--r-- | include/linux/fscrypt.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 4f5f8a651213..433504422d02 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -257,8 +257,8 @@ int fscrypt_encrypt_block_inplace(const struct inode *inode, struct page *page, unsigned int len, unsigned int offs, u64 lblk_num, gfp_t gfp_flags); -int fscrypt_decrypt_pagecache_blocks(struct page *page, unsigned int len, - unsigned int offs); +int fscrypt_decrypt_pagecache_blocks(struct folio *folio, size_t len, + size_t offs); int fscrypt_decrypt_block_inplace(const struct inode *inode, struct page *page, unsigned int len, unsigned int offs, u64 lblk_num); @@ -422,9 +422,8 @@ static inline int fscrypt_encrypt_block_inplace(const struct inode *inode, return -EOPNOTSUPP; } -static inline int fscrypt_decrypt_pagecache_blocks(struct page *page, - unsigned int len, - unsigned int offs) +static inline int fscrypt_decrypt_pagecache_blocks(struct folio *folio, + size_t len, size_t offs) { return -EOPNOTSUPP; } |