~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/fscrypt_notsupp.h

Version: ~ [ linux-5.5-rc7 ] ~ [ linux-5.4.13 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.97 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.166 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.210 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.210 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * fscrypt_notsupp.h
  3  *
  4  * This stubs out the fscrypt functions for filesystems configured without
  5  * encryption support.
  6  */
  7 
  8 #ifndef _LINUX_FSCRYPT_NOTSUPP_H
  9 #define _LINUX_FSCRYPT_NOTSUPP_H
 10 
 11 #include <linux/fscrypt_common.h>
 12 
 13 /* crypto.c */
 14 static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode,
 15                                                   gfp_t gfp_flags)
 16 {
 17         return ERR_PTR(-EOPNOTSUPP);
 18 }
 19 
 20 static inline void fscrypt_release_ctx(struct fscrypt_ctx *ctx)
 21 {
 22         return;
 23 }
 24 
 25 static inline struct page *fscrypt_encrypt_page(const struct inode *inode,
 26                                                 struct page *page,
 27                                                 unsigned int len,
 28                                                 unsigned int offs,
 29                                                 u64 lblk_num, gfp_t gfp_flags)
 30 {
 31         return ERR_PTR(-EOPNOTSUPP);
 32 }
 33 
 34 static inline int fscrypt_decrypt_page(const struct inode *inode,
 35                                        struct page *page,
 36                                        unsigned int len, unsigned int offs,
 37                                        u64 lblk_num)
 38 {
 39         return -EOPNOTSUPP;
 40 }
 41 
 42 
 43 static inline void fscrypt_restore_control_page(struct page *page)
 44 {
 45         return;
 46 }
 47 
 48 static inline void fscrypt_set_d_op(struct dentry *dentry)
 49 {
 50         return;
 51 }
 52 
 53 static inline void fscrypt_set_encrypted_dentry(struct dentry *dentry)
 54 {
 55         return;
 56 }
 57 
 58 /* policy.c */
 59 static inline int fscrypt_ioctl_set_policy(struct file *filp,
 60                                            const void __user *arg)
 61 {
 62         return -EOPNOTSUPP;
 63 }
 64 
 65 static inline int fscrypt_ioctl_get_policy(struct file *filp, void __user *arg)
 66 {
 67         return -EOPNOTSUPP;
 68 }
 69 
 70 static inline int fscrypt_has_permitted_context(struct inode *parent,
 71                                                 struct inode *child)
 72 {
 73         return 0;
 74 }
 75 
 76 static inline int fscrypt_inherit_context(struct inode *parent,
 77                                           struct inode *child,
 78                                           void *fs_data, bool preload)
 79 {
 80         return -EOPNOTSUPP;
 81 }
 82 
 83 /* keyinfo.c */
 84 static inline int fscrypt_get_encryption_info(struct inode *inode)
 85 {
 86         return -EOPNOTSUPP;
 87 }
 88 
 89 static inline void fscrypt_put_encryption_info(struct inode *inode,
 90                                                struct fscrypt_info *ci)
 91 {
 92         return;
 93 }
 94 
 95  /* fname.c */
 96 static inline int fscrypt_setup_filename(struct inode *dir,
 97                                          const struct qstr *iname,
 98                                          int lookup, struct fscrypt_name *fname)
 99 {
100         if (dir->i_sb->s_cop->is_encrypted(dir))
101                 return -EOPNOTSUPP;
102 
103         memset(fname, 0, sizeof(struct fscrypt_name));
104         fname->usr_fname = iname;
105         fname->disk_name.name = (unsigned char *)iname->name;
106         fname->disk_name.len = iname->len;
107         return 0;
108 }
109 
110 static inline void fscrypt_free_filename(struct fscrypt_name *fname)
111 {
112         return;
113 }
114 
115 static inline u32 fscrypt_fname_encrypted_size(const struct inode *inode,
116                                                u32 ilen)
117 {
118         /* never happens */
119         WARN_ON(1);
120         return 0;
121 }
122 
123 static inline int fscrypt_fname_alloc_buffer(const struct inode *inode,
124                                              u32 ilen,
125                                              struct fscrypt_str *crypto_str)
126 {
127         return -EOPNOTSUPP;
128 }
129 
130 static inline void fscrypt_fname_free_buffer(struct fscrypt_str *crypto_str)
131 {
132         return;
133 }
134 
135 static inline int fscrypt_fname_disk_to_usr(struct inode *inode,
136                                             u32 hash, u32 minor_hash,
137                                             const struct fscrypt_str *iname,
138                                             struct fscrypt_str *oname)
139 {
140         return -EOPNOTSUPP;
141 }
142 
143 static inline int fscrypt_fname_usr_to_disk(struct inode *inode,
144                                             const struct qstr *iname,
145                                             struct fscrypt_str *oname)
146 {
147         return -EOPNOTSUPP;
148 }
149 
150 static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
151                                       const u8 *de_name, u32 de_name_len)
152 {
153         /* Encryption support disabled; use standard comparison */
154         if (de_name_len != fname->disk_name.len)
155                 return false;
156         return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
157 }
158 
159 /* bio.c */
160 static inline void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *ctx,
161                                              struct bio *bio)
162 {
163         return;
164 }
165 
166 static inline void fscrypt_pullback_bio_page(struct page **page, bool restore)
167 {
168         return;
169 }
170 
171 static inline int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
172                                         sector_t pblk, unsigned int len)
173 {
174         return -EOPNOTSUPP;
175 }
176 
177 #endif  /* _LINUX_FSCRYPT_NOTSUPP_H */
178 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp