Lines Matching refs:inode

79 	 * that assume inode numbers fit in 32 bits (i.e.
113 * Get the fscrypt context of the given inode.
115 * @inode: the inode whose context to get
121 * inode doesn't have a context, -ERANGE if the context is
124 int (*get_context)(struct inode *inode, void *ctx, size_t len);
127 * Set an fscrypt context on the given inode.
129 * @inode: the inode whose context to set. The inode won't already have
142 int (*set_context)(struct inode *inode, const void *ctx, size_t len,
159 bool (*empty_dir)(struct inode *inode);
162 * Check whether the filesystem's inode numbers and UUID are stable,
198 fscrypt_get_inode_info(const struct inode *inode)
206 return smp_load_acquire(&inode->i_crypt_info);
210 * fscrypt_needs_contents_encryption() - check whether an inode needs
212 * @inode: the inode to check
214 * Return: %true iff the inode is an encrypted regular file and the kernel was
220 static inline bool fscrypt_needs_contents_encryption(const struct inode *inode)
222 return IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode);
266 * encryption key, but just checking for the key on the directory inode during
316 int fscrypt_encrypt_block_inplace(const struct inode *inode, struct page *page,
322 int fscrypt_decrypt_block_inplace(const struct inode *inode, struct page *page,
353 int fscrypt_has_permitted_context(struct inode *parent, struct inode *child);
354 int fscrypt_context_for_new_inode(void *ctx, struct inode *inode);
355 int fscrypt_set_context(struct inode *inode, void *fs_data);
387 int fscrypt_prepare_new_inode(struct inode *dir, struct inode *inode,
389 void fscrypt_put_encryption_info(struct inode *inode);
390 void fscrypt_free_inode(struct inode *inode);
391 int fscrypt_drop_inode(struct inode *inode);
394 int fscrypt_fname_encrypt(const struct inode *inode, const struct qstr *iname,
396 bool fscrypt_fname_encrypted_size(const struct inode *inode, u32 orig_len,
398 int fscrypt_setup_filename(struct inode *inode, const struct qstr *iname,
409 int fscrypt_fname_disk_to_usr(const struct inode *inode,
415 u64 fscrypt_fname_siphash(const struct inode *dir, const struct qstr *name);
419 int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
423 int fscrypt_file_open(struct inode *inode, struct file *filp);
424 int __fscrypt_prepare_link(struct inode *inode, struct inode *dir,
426 int __fscrypt_prepare_rename(struct inode *old_dir, struct dentry *old_dentry,
427 struct inode *new_dir, struct dentry *new_dentry,
429 int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry,
431 int fscrypt_prepare_lookup_partial(struct inode *dir, struct dentry *dentry);
432 int __fscrypt_prepare_readdir(struct inode *dir);
434 int fscrypt_prepare_setflags(struct inode *inode,
436 int fscrypt_prepare_symlink(struct inode *dir, const char *target,
439 int __fscrypt_encrypt_symlink(struct inode *inode, const char *target,
441 const char *fscrypt_get_symlink(struct inode *inode, const void *caddr,
453 fscrypt_get_inode_info(const struct inode *inode)
458 static inline bool fscrypt_needs_contents_encryption(const struct inode *inode)
490 static inline int fscrypt_encrypt_block_inplace(const struct inode *inode,
505 static inline int fscrypt_decrypt_block_inplace(const struct inode *inode,
562 static inline int fscrypt_has_permitted_context(struct inode *parent,
563 struct inode *child)
568 static inline int fscrypt_set_context(struct inode *inode, void *fs_data)
636 static inline int fscrypt_prepare_new_inode(struct inode *dir,
637 struct inode *inode,
645 static inline void fscrypt_put_encryption_info(struct inode *inode)
650 static inline void fscrypt_free_inode(struct inode *inode)
654 static inline int fscrypt_drop_inode(struct inode *inode)
660 static inline int fscrypt_setup_filename(struct inode *dir,
690 static inline int fscrypt_fname_disk_to_usr(const struct inode *inode,
707 static inline u64 fscrypt_fname_siphash(const struct inode *dir,
726 static inline int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
734 static inline int fscrypt_file_open(struct inode *inode, struct file *filp)
736 if (IS_ENCRYPTED(inode))
741 static inline int __fscrypt_prepare_link(struct inode *inode, struct inode *dir,
747 static inline int __fscrypt_prepare_rename(struct inode *old_dir,
749 struct inode *new_dir,
756 static inline int __fscrypt_prepare_lookup(struct inode *dir,
763 static inline int fscrypt_prepare_lookup_partial(struct inode *dir,
769 static inline int __fscrypt_prepare_readdir(struct inode *dir)
780 static inline int fscrypt_prepare_setflags(struct inode *inode,
787 static inline int fscrypt_prepare_symlink(struct inode *dir,
802 static inline int __fscrypt_encrypt_symlink(struct inode *inode,
810 static inline const char *fscrypt_get_symlink(struct inode *inode,
834 bool __fscrypt_inode_uses_inline_crypto(const struct inode *inode);
837 const struct inode *inode, u64 first_lblk,
844 bool fscrypt_mergeable_bio(struct bio *bio, const struct inode *inode,
850 bool fscrypt_dio_supported(struct inode *inode);
852 u64 fscrypt_limit_io_blocks(const struct inode *inode, u64 lblk, u64 nr_blocks);
856 static inline bool __fscrypt_inode_uses_inline_crypto(const struct inode *inode)
862 const struct inode *inode,
871 const struct inode *inode,
883 static inline bool fscrypt_dio_supported(struct inode *inode)
885 return !fscrypt_needs_contents_encryption(inode);
888 static inline u64 fscrypt_limit_io_blocks(const struct inode *inode, u64 lblk,
896 * fscrypt_inode_uses_inline_crypto() - test whether an inode uses inline
898 * @inode: an inode. If encrypted, its key must be set up.
900 * Return: true if the inode requires file contents encryption and if the
904 static inline bool fscrypt_inode_uses_inline_crypto(const struct inode *inode)
906 return fscrypt_needs_contents_encryption(inode) &&
907 __fscrypt_inode_uses_inline_crypto(inode);
911 * fscrypt_inode_uses_fs_layer_crypto() - test whether an inode uses fs-layer
913 * @inode: an inode. If encrypted, its key must be set up.
915 * Return: true if the inode requires file contents encryption and if the
919 static inline bool fscrypt_inode_uses_fs_layer_crypto(const struct inode *inode)
921 return fscrypt_needs_contents_encryption(inode) &&
922 !__fscrypt_inode_uses_inline_crypto(inode);
926 * fscrypt_has_encryption_key() - check whether an inode has had its key set up
927 * @inode: the inode to check
929 * Return: %true if the inode has had its encryption key set up, else %false.
934 static inline bool fscrypt_has_encryption_key(const struct inode *inode)
936 return fscrypt_get_inode_info(inode) != NULL;
940 * fscrypt_prepare_link() - prepare to link an inode into a possibly-encrypted
942 * @old_dentry: an existing dentry for the inode being linked
958 struct inode *dir,
988 static inline int fscrypt_prepare_rename(struct inode *old_dir,
990 struct inode *new_dir,
1023 static inline int fscrypt_prepare_lookup(struct inode *dir,
1042 * @dir: the directory inode
1053 static inline int fscrypt_prepare_readdir(struct inode *dir)
1061 * fscrypt_prepare_setattr() - prepare to change a possibly-encrypted inode's
1063 * @dentry: dentry through which the inode is being changed
1066 * Prepare for ->setattr() on a possibly-encrypted inode. On an encrypted file,
1088 * @inode: symlink inode
1101 static inline int fscrypt_encrypt_symlink(struct inode *inode,
1106 if (IS_ENCRYPTED(inode))
1107 return __fscrypt_encrypt_symlink(inode, target, len, disk_link);