/* Maximum value for the third parameter of llcrypt_operations.set_context(). */
#define LLCRYPT_SET_CONTEXT_MAX_SIZE 40
+#define LLCRYPT_DIGESTED_CHAR_OLD '_'
+#define LLCRYPT_DIGESTED_CHAR '+'
#ifdef CONFIG_LL_ENCRYPTION
/*
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)
{
void *, bool);
extern bool llcrypt_policy_has_filename_enc(struct inode *inode);
/* keyring.c */
-extern void llcrypt_sb_free(struct super_block *sb);
+extern void llcrypt_sb_free(struct lustre_sb_info *lsi);
extern int llcrypt_ioctl_add_key(struct file *filp, void __user *arg);
extern int llcrypt_ioctl_remove_key(struct file *filp, void __user *arg);
extern int llcrypt_ioctl_remove_key_all_users(struct file *filp,
return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
}
-/* bio.c */
-extern void llcrypt_decrypt_bio(struct bio *);
-extern void llcrypt_enqueue_decrypt_bio(struct llcrypt_ctx *ctx,
- struct bio *bio);
-extern int llcrypt_zeroout_range(const struct inode *, pgoff_t, sector_t,
- unsigned int);
-
/* hooks.c */
extern int llcrypt_file_open(struct inode *inode, struct file *filp);
extern int __llcrypt_prepare_link(struct inode *inode, struct inode *dir,
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;
}
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,
}
/* keyring.c */
-static inline void llcrypt_sb_free(struct super_block *sb)
+static inline void llcrypt_sb_free(struct lustre_sb_info *lsi)
{
}
return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
}
-/* bio.c */
-static inline void llcrypt_decrypt_bio(struct bio *bio)
-{
-}
-
-static inline void llcrypt_enqueue_decrypt_bio(struct llcrypt_ctx *ctx,
- struct bio *bio)
-{
-}
-
-static inline int llcrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
- sector_t pblk, unsigned int len)
-{
- return -EOPNOTSUPP;
-}
-
/* hooks.c */
static inline int llcrypt_file_open(struct inode *inode, struct file *filp)
unsigned int max_len,
struct llcrypt_str *disk_link)
{
- if ((IS_ENCRYPTED(dir) &&
- llcrypt_policy_has_filename_enc(dir)) ||
- llcrypt_dummy_context_enabled(dir))
+ if ((IS_ENCRYPTED(dir) || llcrypt_dummy_context_enabled(dir)) &&
+ llcrypt_policy_has_filename_enc(dir))
return __llcrypt_prepare_symlink(dir, len, max_len, disk_link);
disk_link->name = (unsigned char *)target;