aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fscrypt_notsupp.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-04-18 14:09:47 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2018-05-02 17:30:57 -0400
commit0cb8dae4a0df2a977847c2dc6766a7783ce50f9d (patch)
tree31a349816ada3856f84a1be5639e1192236a698b /include/linux/fscrypt_notsupp.h
parent2d618bdf71635463a4aa4ad0fe46ec852292bc0c (diff)
fscrypt: allow synchronous bio decryption
Currently, fscrypt provides fscrypt_decrypt_bio_pages() which decrypts a bio's pages asynchronously, then unlocks them afterwards. But, this assumes that decryption is the last "postprocessing step" for the bio, so it's incompatible with additional postprocessing steps such as authenticity verification after decryption. Therefore, rename the existing fscrypt_decrypt_bio_pages() to fscrypt_enqueue_decrypt_bio(). Then, add fscrypt_decrypt_bio() which decrypts the pages in the bio synchronously without unlocking the pages, nor setting them Uptodate; and add fscrypt_enqueue_decrypt_work(), which enqueues work on the fscrypt_read_workqueue. The new functions will be used by filesystems that support both fscrypt and fs-verity. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/linux/fscrypt_notsupp.h')
-rw-r--r--include/linux/fscrypt_notsupp.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h
index 44b50c04bae9..9770be37c9d4 100644
--- a/include/linux/fscrypt_notsupp.h
+++ b/include/linux/fscrypt_notsupp.h
@@ -25,6 +25,10 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
25} 25}
26 26
27/* crypto.c */ 27/* crypto.c */
28static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work)
29{
30}
31
28static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode, 32static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode,
29 gfp_t gfp_flags) 33 gfp_t gfp_flags)
30{ 34{
@@ -160,10 +164,13 @@ static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
160} 164}
161 165
162/* bio.c */ 166/* bio.c */
163static inline void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *ctx, 167static inline void fscrypt_decrypt_bio(struct bio *bio)
164 struct bio *bio) 168{
169}
170
171static inline void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx,
172 struct bio *bio)
165{ 173{
166 return;
167} 174}
168 175
169static inline void fscrypt_pullback_bio_page(struct page **page, bool restore) 176static inline void fscrypt_pullback_bio_page(struct page **page, bool restore)