summaryrefslogtreecommitdiffstats
path: root/include/linux/fscrypt.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-05-20 12:29:47 -0400
committerEric Biggers <ebiggers@google.com>2019-05-28 13:27:53 -0400
commitaa8bc1ac6ef32a332671ca25e06cfd277a3839a5 (patch)
tree40a7109717078adacb8bed18199f35fb706f36f3 /include/linux/fscrypt.h
parent41adbcb7267b0060682576d523956160b5c617bd (diff)
fscrypt: support decrypting multiple filesystem blocks per page
Rename fscrypt_decrypt_page() to fscrypt_decrypt_pagecache_blocks() and redefine its behavior to decrypt all filesystem blocks in the given region of the given page, rather than assuming that the region consists of just one filesystem block. Also remove the 'inode' and 'lblk_num' parameters, since they can be retrieved from the page as it's already assumed to be a pagecache page. This is in preparation for allowing encryption on ext4 filesystems with blocksize != PAGE_SIZE. This is based on work by Chandan Rajendra. Reviewed-by: Chandan Rajendra <chandan@linux.ibm.com> Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'include/linux/fscrypt.h')
-rw-r--r--include/linux/fscrypt.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h
index 315affc99b05..bd8f207a2fb6 100644
--- a/include/linux/fscrypt.h
+++ b/include/linux/fscrypt.h
@@ -112,8 +112,9 @@ extern int fscrypt_encrypt_block_inplace(const struct inode *inode,
112 struct page *page, unsigned int len, 112 struct page *page, unsigned int len,
113 unsigned int offs, u64 lblk_num, 113 unsigned int offs, u64 lblk_num,
114 gfp_t gfp_flags); 114 gfp_t gfp_flags);
115extern int fscrypt_decrypt_page(const struct inode *, struct page *, unsigned int, 115
116 unsigned int, u64); 116extern int fscrypt_decrypt_pagecache_blocks(struct page *page, unsigned int len,
117 unsigned int offs);
117extern int fscrypt_decrypt_block_inplace(const struct inode *inode, 118extern int fscrypt_decrypt_block_inplace(const struct inode *inode,
118 struct page *page, unsigned int len, 119 struct page *page, unsigned int len,
119 unsigned int offs, u64 lblk_num); 120 unsigned int offs, u64 lblk_num);
@@ -310,10 +311,9 @@ static inline int fscrypt_encrypt_block_inplace(const struct inode *inode,
310 return -EOPNOTSUPP; 311 return -EOPNOTSUPP;
311} 312}
312 313
313static inline int fscrypt_decrypt_page(const struct inode *inode, 314static inline int fscrypt_decrypt_pagecache_blocks(struct page *page,
314 struct page *page, 315 unsigned int len,
315 unsigned int len, unsigned int offs, 316 unsigned int offs)
316 u64 lblk_num)
317{ 317{
318 return -EOPNOTSUPP; 318 return -EOPNOTSUPP;
319} 319}