Whamcloud - gitweb
LU-15003 sec: use enc pool for bounce pages
[fs/lustre-release.git] / libcfs / include / libcfs / crypto / llcrypt.h
index 5df68c4..893ac1e 100644 (file)
@@ -121,16 +121,26 @@ extern struct page *llcrypt_encrypt_pagecache_blocks(struct page *page,
                                                     unsigned int len,
                                                     unsigned int offs,
                                                     gfp_t gfp_flags);
-extern int llcrypt_encrypt_block_inplace(const struct inode *inode,
-                                        struct page *page, unsigned int len,
-                                        unsigned int offs, u64 lblk_num,
-                                        gfp_t gfp_flags);
+extern int llcrypt_encrypt_block(const struct inode *inode, struct page *src,
+                        struct page *dst, unsigned int len,
+                        unsigned int offs, u64 lblk_num, gfp_t gfp_flags);
 
 extern int llcrypt_decrypt_pagecache_blocks(struct page *page, unsigned int len,
                                            unsigned int offs);
-extern int llcrypt_decrypt_block_inplace(const struct inode *inode,
-                                        struct page *page, unsigned int len,
-                                        unsigned int offs, u64 lblk_num);
+
+extern int llcrypt_decrypt_block(const struct inode *inode, struct page *src,
+                        struct page *dst, unsigned int len,
+                        unsigned int offs, u64 lblk_num, gfp_t gfp_flags);
+
+static inline int llcrypt_decrypt_block_inplace(const struct inode *inode,
+                                               struct page *page,
+                                               unsigned int len,
+                                               unsigned int offs,
+                                               u64 lblk_num)
+{
+       return llcrypt_decrypt_block(inode, page, page, len, offs, lblk_num,
+                                    GFP_NOFS);
+}
 
 static inline bool llcrypt_is_bounce_page(struct page *page)
 {
@@ -336,11 +346,10 @@ static inline struct page *llcrypt_encrypt_pagecache_blocks(struct page *page,
        return ERR_PTR(-EOPNOTSUPP);
 }
 
-static inline int llcrypt_encrypt_block_inplace(const struct inode *inode,
-                                               struct page *page,
-                                               unsigned int len,
-                                               unsigned int offs, u64 lblk_num,
-                                               gfp_t gfp_flags)
+static inline int llcrypt_encrypt_block(const struct inode *inode,
+                                       struct page *src, struct page *dst,
+                                       unsigned int len, unsigned int offs,
+                                       u64 lblk_num, gfp_t gfp_flags)
 {
        return -EOPNOTSUPP;
 }
@@ -352,6 +361,14 @@ static inline int llcrypt_decrypt_pagecache_blocks(struct page *page,
        return -EOPNOTSUPP;
 }
 
+static inline int llcrypt_decrypt_block(const struct inode *inode,
+                                       struct page *src, struct page *dst,
+                                       unsigned int len, unsigned int offs,
+                                       u64 lblk_num, gfp_t gfp_flags)
+{
+       return -EOPNOTSUPP;
+}
+
 static inline int llcrypt_decrypt_block_inplace(const struct inode *inode,
                                                struct page *page,
                                                unsigned int len,