Whamcloud - gitweb
LU-12275 sec: remove bio functions in fscrypt compat
[fs/lustre-release.git] / contrib / scripts / crypto_patches / 0006_bvec_iter_all.patch
1 LU-12275 sec: disable bio functions on client
2     
3 diff --git a/libcfs/include/libcfs/crypto/llcrypt.h b/libcfs/include/libcfs/crypto/llcrypt.h
4 index b152915fb1..93e1766edc 100644
5 --- a/libcfs/include/libcfs/crypto/llcrypt.h
6 +++ b/libcfs/include/libcfs/crypto/llcrypt.h
7 @@ -267,12 +267,14 @@ static inline bool llcrypt_match_name(const struct llcrypt_name *fname,
8         return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
9  }
10  
11 +#ifdef HAVE_SERVER_SUPPORT
12  /* bio.c */
13  extern void llcrypt_decrypt_bio(struct bio *);
14  extern void llcrypt_enqueue_decrypt_bio(struct llcrypt_ctx *ctx,
15                                         struct bio *bio);
16  extern int llcrypt_zeroout_range(const struct inode *, pgoff_t, sector_t,
17                                  unsigned int);
18 +#endif
19  
20  /* hooks.c */
21  extern int llcrypt_file_open(struct inode *inode, struct file *filp);
22 @@ -525,6 +527,7 @@ static inline bool llcrypt_match_name(const struct llcrypt_name *fname,
23         return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
24  }
25  
26 +#ifdef HAVE_SERVER_SUPPORT
27  /* bio.c */
28  static inline void llcrypt_decrypt_bio(struct bio *bio)
29  {
30 @@ -540,6 +543,7 @@ static inline int llcrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
31  {
32         return -EOPNOTSUPP;
33  }
34 +#endif
35  
36  /* hooks.c */
37  
38 diff --git a/libcfs/libcfs/crypto/bio.c b/libcfs/libcfs/crypto/bio.c
39 index 78b56cbd36..02ecacff5e 100644
40 --- a/libcfs/libcfs/crypto/bio.c
41 +++ b/libcfs/libcfs/crypto/bio.c
42 @@ -24,6 +24,7 @@
43   * tags/v5.4
44   */
45  
46 +#ifdef HAVE_SERVER_SUPPORT
47  #include <linux/pagemap.h>
48  #include <linux/module.h>
49  #include <linux/bio.h>
50 @@ -126,3 +127,4 @@ errout:
51         return err;
52  }
53  EXPORT_SYMBOL(llcrypt_zeroout_range);
54 +#endif