summaryrefslogtreecommitdiff
path: root/include/linux/fscrypto.h
diff options
context:
space:
mode:
authorDavid Gstir <david@sigma-star.at>2016-11-13 22:20:46 +0100
committerTheodore Ts'o <tytso@mit.edu>2016-11-13 18:55:21 -0500
commit7821d4dd4589ce5af54f3e46d04a29439ba3c2e5 (patch)
treec9c424077630d6bec61a22905e7fec2cef9a9a8f /include/linux/fscrypto.h
parentb50f7b268bad8088dfe7579a65cd910d8cc5c40f (diff)
fscrypt: Enable partial page encryption
Not all filesystems work on full pages, thus we should allow them to hand partial pages to fscrypt for en/decryption. Signed-off-by: David Gstir <david@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/fscrypto.h')
-rw-r--r--include/linux/fscrypto.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h
index 8be8e9657c63..e05931272cea 100644
--- a/include/linux/fscrypto.h
+++ b/include/linux/fscrypto.h
@@ -248,8 +248,11 @@ int fscrypt_initialize(void);
extern struct fscrypt_ctx *fscrypt_get_ctx(struct inode *, gfp_t);
extern void fscrypt_release_ctx(struct fscrypt_ctx *);
-extern struct page *fscrypt_encrypt_page(struct inode *, struct page *, gfp_t);
-extern int fscrypt_decrypt_page(struct inode *, struct page *);
+extern struct page *fscrypt_encrypt_page(struct inode *, struct page *,
+ unsigned int, unsigned int,
+ gfp_t);
+extern int fscrypt_decrypt_page(struct inode *, struct page *, unsigned int,
+ unsigned int);
extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *);
extern void fscrypt_pullback_bio_page(struct page **, bool);
extern void fscrypt_restore_control_page(struct page *);
@@ -293,13 +296,16 @@ static inline void fscrypt_notsupp_release_ctx(struct fscrypt_ctx *c)
}
static inline struct page *fscrypt_notsupp_encrypt_page(struct inode *i,
- struct page *p, gfp_t f)
+ struct page *p,
+ unsigned int len,
+ unsigned int offs,
+ gfp_t f)
{
return ERR_PTR(-EOPNOTSUPP);
}
-static inline int fscrypt_notsupp_decrypt_page(struct inode *i,
- struct page *p)
+static inline int fscrypt_notsupp_decrypt_page(struct inode *i, struct page *p,
+ unsigned int len, unsigned int offs)
{
return -EOPNOTSUPP;
}