fs/ext4/ext4.h
Source file repositories/reference/linux-study-clean/fs/ext4/ext4.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ext4/ext4.h- Extension
.h- Size
- 142912 bytes
- Lines
- 4042
- 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
linux/refcount.hlinux/types.hlinux/blkdev.hlinux/magic.hlinux/jbd2.hlinux/quota.hlinux/rwsem.hlinux/rbtree.hlinux/seqlock.hlinux/mutex.hlinux/timer.hlinux/sched/signal.hlinux/blockgroup_lock.hlinux/percpu_counter.hlinux/ratelimit.hlinux/crc32c.hlinux/falloc.hlinux/percpu-rwsem.hlinux/fiemap.hlinux/compat.huapi/linux/ext4.hlinux/fscrypt.hlinux/fsverity.hlinux/compiler.hextents_status.hfast_commit.h
Detected Declarations
struct ext4_allocation_requeststruct ext4_map_blocksstruct ext4_system_blocksstruct ext4_io_end_vecstruct ext4_io_submitstruct ext4_group_descstruct flex_groupsstruct compat_ext4_new_group_inputstruct ext4_new_group_datastruct ext4_inodestruct ext4_fc_inode_snapstruct ext4_inode_infostruct ext4_super_blockstruct ext4_journal_triggerstruct ext4_orphan_block_tailstruct ext4_orphan_blockstruct ext4_orphan_infostruct ext4_fc_snap_statsstruct ext4_sb_infostruct ext4_dir_entrystruct ext4_dir_entry_hashstruct ext4_dir_entry_2struct ext4_dir_entry_tailstruct dx_hash_infostruct ext4_filenamestruct ext4_ilocstruct dir_private_infostruct ext4_lazy_initstruct ext4_li_requeststruct ext4_featuresstruct mmp_structstruct mmpd_datastruct ext4_group_infostruct iomapstruct ext4_ext_pathstruct ext4_extentenum SHIFT_DIRECTIONenum criteriaenum ext4_fc_snap_errenum ext4_journal_trigger_typeenum ext4_li_modefunction ext4_mask_flagsfunction ext4_check_flag_valuesfunction inodesfunction ext4_decode_extra_timefunction EXT4_INODE_SET_XTIME_VALfunction ext4_inodes_per_orphan_blockfunction ext4_writepages_down_read
Annotated Snippet
extern const struct file_operations ext4_dir_operations;
/* file.c */
extern const struct inode_operations ext4_file_inode_operations;
extern const struct file_operations ext4_file_operations;
extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin);
/* inline.c */
extern int ext4_get_max_inline_size(struct inode *inode);
extern int ext4_find_inline_data_nolock(struct inode *inode);
extern int ext4_destroy_inline_data(handle_t *handle, struct inode *inode);
extern void ext4_update_final_de(void *de_buf, int old_size, int new_size);
int ext4_readpage_inline(struct inode *inode, struct folio *folio);
extern int ext4_try_to_write_inline_data(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
struct folio **foliop);
int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
unsigned copied, struct folio *folio);
extern int ext4_generic_write_inline_data(struct address_space *mapping,
struct inode *inode,
loff_t pos, unsigned len,
struct folio **foliop,
void **fsdata, bool da);
extern int ext4_try_add_inline_entry(handle_t *handle,
struct ext4_filename *fname,
struct inode *dir, struct inode *inode);
extern int ext4_try_create_inline_dir(handle_t *handle,
struct inode *parent,
struct inode *inode);
extern int ext4_read_inline_dir(struct file *filp,
struct dir_context *ctx,
int *has_inline_data);
extern int ext4_inlinedir_to_tree(struct file *dir_file,
struct inode *dir, ext4_lblk_t block,
struct dx_hash_info *hinfo,
__u32 start_hash, __u32 start_minor_hash,
int *has_inline_data);
extern struct buffer_head *ext4_find_inline_entry(struct inode *dir,
struct ext4_filename *fname,
struct ext4_dir_entry_2 **res_dir,
int *has_inline_data);
extern int ext4_delete_inline_entry(handle_t *handle,
struct inode *dir,
struct ext4_dir_entry_2 *de_del,
struct buffer_head *bh,
int *has_inline_data);
extern bool empty_inline_dir(struct inode *dir, int *has_inline_data);
extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode,
struct ext4_dir_entry_2 **parent_de,
int *retval);
extern void *ext4_read_inline_link(struct inode *inode);
struct iomap;
extern int ext4_inline_data_iomap(struct inode *inode, struct iomap *iomap);
extern int ext4_inline_data_truncate(struct inode *inode, int *has_inline);
extern int ext4_convert_inline_data(struct inode *inode);
static inline int ext4_has_inline_data(struct inode *inode)
{
return ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA) &&
EXT4_I(inode)->i_inline_off;
}
/* namei.c */
extern const struct inode_operations ext4_dir_inode_operations;
extern const struct inode_operations ext4_special_inode_operations;
extern struct dentry *ext4_get_parent(struct dentry *child);
extern int ext4_init_dirblock(handle_t *handle, struct inode *inode,
struct buffer_head *dir_block,
unsigned int parent_ino, void *inline_buf,
int inline_size);
extern void ext4_initialize_dirent_tail(struct buffer_head *bh,
unsigned int blocksize);
extern int ext4_handle_dirty_dirblock(handle_t *handle, struct inode *inode,
struct buffer_head *bh);
extern int __ext4_unlink(struct inode *dir, const struct qstr *d_name,
struct inode *inode, struct dentry *dentry);
extern int __ext4_link(struct inode *dir, struct inode *inode,
const struct qstr *d_name, struct dentry *dentry);
#define S_SHIFT 12
static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = {
[S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE,
[S_IFDIR >> S_SHIFT] = EXT4_FT_DIR,
[S_IFCHR >> S_SHIFT] = EXT4_FT_CHRDEV,
[S_IFBLK >> S_SHIFT] = EXT4_FT_BLKDEV,
Annotation
- Immediate include surface: `linux/refcount.h`, `linux/types.h`, `linux/blkdev.h`, `linux/magic.h`, `linux/jbd2.h`, `linux/quota.h`, `linux/rwsem.h`, `linux/rbtree.h`.
- Detected declarations: `struct ext4_allocation_request`, `struct ext4_map_blocks`, `struct ext4_system_blocks`, `struct ext4_io_end_vec`, `struct ext4_io_submit`, `struct ext4_group_desc`, `struct flex_groups`, `struct compat_ext4_new_group_input`, `struct ext4_new_group_data`, `struct ext4_inode`.
- 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.