Whamcloud - gitweb
LU-12275 sec: add llcrypt as file encryption library
[fs/lustre-release.git] / contrib / scripts / crypto_patches / 0015_llcrypt_include.patch
1 In case llcrypt is not built (CONFIG_LL_ENCRYPTION undefined),
2 we need to have stubs for llcrypt init/exit functions.
3
4 --- a/libcfs/include/libcfs/crypto/llcrypt.h
5 +++ b/libcfs/include/libcfs/crypto/llcrypt.h
6 @@ -287,6 +287,13 @@ static inline void llcrypt_set_ops(struc
7  }
8  #else  /* !CONFIG_LL_ENCRYPTION */
9  
10 +struct llcrypt_operations;
11 +#define llcrypt_init()         0
12 +#define llcrypt_exit()         {}
13 +
14 +#undef IS_ENCRYPTED
15 +#define IS_ENCRYPTED(x)        0
16 +
17  static inline bool llcrypt_has_encryption_key(const struct inode *inode)
18  {
19         return false;
20 @@ -554,13 +561,7 @@ static inline int __llcrypt_encrypt_syml
21         return -EOPNOTSUPP;
22  }
23  
24 -static inline const char *llcrypt_get_symlink(struct inode *inode,
25 -                                             const void *caddr,
26 -                                             unsigned int max_size,
27 -                                             struct delayed_call *done)
28 -{
29 -       return ERR_PTR(-EOPNOTSUPP);
30 -}
31 +#define llcrypt_get_symlink(inode, caddr, max_size, done)   ERR_PTR(-EOPNOTSUPP)
32  
33  static inline void llcrypt_set_ops(struct super_block *sb,
34                                    const struct llcrypt_operations *lsi_cop)