fs/ecryptfs/ecryptfs_kernel.h
Source file repositories/reference/linux-study-clean/fs/ecryptfs/ecryptfs_kernel.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ecryptfs/ecryptfs_kernel.h- Extension
.h- Size
- 24136 bytes
- Lines
- 697
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
crypto/md5.hcrypto/skcipher.hkeys/user-type.hkeys/encrypted-type.hlinux/kernel.hlinux/fs.hlinux/fs_stack.hlinux/hex.hlinux/namei.hlinux/scatterlist.hlinux/hash.hlinux/nsproxy.hlinux/backing-dev.hlinux/ecryptfs.h
Detected Declarations
struct ecryptfs_key_recordstruct ecryptfs_auth_tok_liststruct ecryptfs_crypt_statstruct ecryptfs_mount_crypt_statstruct ecryptfs_page_crypt_contextstruct ecryptfs_key_sigstruct ecryptfs_filenamestruct ecryptfs_crypt_statstruct ecryptfs_inode_infostruct ecryptfs_global_auth_tokstruct ecryptfs_key_tfmstruct ecryptfs_mount_crypt_statstruct ecryptfs_sb_infostruct ecryptfs_file_infostruct ecryptfs_auth_tok_list_itemstruct ecryptfs_messagestruct ecryptfs_msg_ctxstruct ecryptfs_daemonfunction ecryptfs_to_hexfunction ecryptfs_get_encrypted_key_payload_datafunction ecryptfs_get_encrypted_key_payload_datafunction ecryptfs_get_key_payload_datafunction ecryptfs_lower_header_sizefunction ecryptfs_file_to_privatefunction ecryptfs_set_file_privatefunction ecryptfs_set_file_lowerfunction ecryptfs_inode_to_privatefunction ecryptfs_set_inode_lowerfunction ecryptfs_superblock_to_privatefunction ecryptfs_set_superblock_privatefunction ecryptfs_superblock_to_lowerfunction ecryptfs_set_superblock_lowerfunction ecryptfs_set_dentry_lowerfunction ecryptfs_dentry_to_lowerfunction ecryptfs_lower_pathfunction ecryptfs_init_messagingfunction ecryptfs_release_messagingfunction ecryptfs_wait_for_response
Annotated Snippet
extern const struct file_operations ecryptfs_main_fops;
extern const struct file_operations ecryptfs_dir_fops;
extern const struct inode_operations ecryptfs_main_iops;
extern const struct inode_operations ecryptfs_dir_iops;
extern const struct inode_operations ecryptfs_symlink_iops;
extern const struct super_operations ecryptfs_sops;
extern const struct dentry_operations ecryptfs_dops;
extern const struct address_space_operations ecryptfs_aops;
extern int ecryptfs_verbosity;
extern unsigned int ecryptfs_message_buf_len;
extern signed long ecryptfs_message_wait_timeout;
extern unsigned int ecryptfs_number_of_users;
extern struct kmem_cache *ecryptfs_auth_tok_list_item_cache;
extern struct kmem_cache *ecryptfs_file_info_cache;
extern struct kmem_cache *ecryptfs_inode_info_cache;
extern struct kmem_cache *ecryptfs_sb_info_cache;
extern struct kmem_cache *ecryptfs_header_cache;
extern struct kmem_cache *ecryptfs_xattr_cache;
extern struct kmem_cache *ecryptfs_key_record_cache;
extern struct kmem_cache *ecryptfs_key_sig_cache;
extern struct kmem_cache *ecryptfs_global_auth_tok_cache;
extern struct kmem_cache *ecryptfs_key_tfm_cache;
struct inode *ecryptfs_get_inode(struct inode *lower_inode,
struct super_block *sb);
void ecryptfs_i_size_init(const char *page_virt, struct inode *inode);
int ecryptfs_initialize_file(struct dentry *ecryptfs_dentry,
struct inode *ecryptfs_inode);
int ecryptfs_decode_and_decrypt_filename(char **decrypted_name,
size_t *decrypted_name_size,
struct super_block *sb,
const char *name, size_t name_size);
int ecryptfs_encrypt_and_encode_filename(
char **encoded_name,
size_t *encoded_name_size,
struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
const char *name, size_t name_size);
void ecryptfs_dump_hex(char *data, int bytes);
int virt_to_scatterlist(const void *addr, int size, struct scatterlist *sg,
int sg_size);
int ecryptfs_compute_root_iv(struct ecryptfs_crypt_stat *crypt_stat);
void ecryptfs_rotate_iv(unsigned char *iv);
void ecryptfs_init_crypt_stat(struct ecryptfs_crypt_stat *crypt_stat);
void ecryptfs_destroy_crypt_stat(struct ecryptfs_crypt_stat *crypt_stat);
void ecryptfs_destroy_mount_crypt_stat(
struct ecryptfs_mount_crypt_stat *mount_crypt_stat);
int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat);
int ecryptfs_write_inode_size_to_metadata(struct inode *ecryptfs_inode);
int ecryptfs_encrypt_page(struct folio *folio);
int ecryptfs_decrypt_page(struct folio *folio);
int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry,
struct inode *ecryptfs_inode);
int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry);
int ecryptfs_new_file_context(struct inode *ecryptfs_inode);
void ecryptfs_write_crypt_stat_flags(char *page_virt,
struct ecryptfs_crypt_stat *crypt_stat,
size_t *written);
int ecryptfs_read_and_validate_header_region(struct inode *inode);
int ecryptfs_read_and_validate_xattr_region(struct dentry *dentry,
struct inode *inode);
u8 ecryptfs_code_for_cipher_string(char *cipher_name, size_t key_bytes);
int ecryptfs_cipher_code_to_string(char *str, size_t size, u8 cipher_code);
void ecryptfs_set_default_sizes(struct ecryptfs_crypt_stat *crypt_stat);
int ecryptfs_generate_key_packet_set(char *dest_base,
struct ecryptfs_crypt_stat *crypt_stat,
struct dentry *ecryptfs_dentry,
size_t *len, size_t max);
int
ecryptfs_parse_packet_set(struct ecryptfs_crypt_stat *crypt_stat,
unsigned char *src, struct dentry *ecryptfs_dentry);
int ecryptfs_truncate(struct dentry *dentry, loff_t new_length);
ssize_t
ecryptfs_getxattr_lower(struct dentry *lower_dentry, struct inode *lower_inode,
const char *name, void *value, size_t size);
int
ecryptfs_setxattr(struct dentry *dentry, struct inode *inode, const char *name,
const void *value, size_t size, int flags);
int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode);
#ifdef CONFIG_ECRYPT_FS_MESSAGING
int ecryptfs_process_response(struct ecryptfs_daemon *daemon,
struct ecryptfs_message *msg, u32 seq);
int ecryptfs_send_message(char *data, int data_len,
struct ecryptfs_msg_ctx **msg_ctx);
int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx,
struct ecryptfs_message **emsg);
int ecryptfs_init_messaging(void);
void ecryptfs_release_messaging(void);
#else
static inline int ecryptfs_init_messaging(void)
Annotation
- Immediate include surface: `crypto/md5.h`, `crypto/skcipher.h`, `keys/user-type.h`, `keys/encrypted-type.h`, `linux/kernel.h`, `linux/fs.h`, `linux/fs_stack.h`, `linux/hex.h`.
- Detected declarations: `struct ecryptfs_key_record`, `struct ecryptfs_auth_tok_list`, `struct ecryptfs_crypt_stat`, `struct ecryptfs_mount_crypt_stat`, `struct ecryptfs_page_crypt_context`, `struct ecryptfs_key_sig`, `struct ecryptfs_filename`, `struct ecryptfs_crypt_stat`, `struct ecryptfs_inode_info`, `struct ecryptfs_global_auth_tok`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.