aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fscrypt_supp.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_supp.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_supp.h')
-rw-r--r--include/linux/fscrypt_supp.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h
index 477a7a6504d2..2c9a86ac5e83 100644
--- a/include/linux/fscrypt_supp.h
+++ b/include/linux/fscrypt_supp.h
@@ -59,6 +59,7 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
59} 59}
60 60
61/* crypto.c */ 61/* crypto.c */
62extern void fscrypt_enqueue_decrypt_work(struct work_struct *);
62extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t); 63extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t);
63extern void fscrypt_release_ctx(struct fscrypt_ctx *); 64extern void fscrypt_release_ctx(struct fscrypt_ctx *);
64extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *, 65extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *,
@@ -188,7 +189,9 @@ static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
188} 189}
189 190
190/* bio.c */ 191/* bio.c */
191extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *); 192extern void fscrypt_decrypt_bio(struct bio *);
193extern void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx,
194 struct bio *bio);
192extern void fscrypt_pullback_bio_page(struct page **, bool); 195extern void fscrypt_pullback_bio_page(struct page **, bool);
193extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t, 196extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t,
194 unsigned int); 197 unsigned int);