fs/ext4/file.c
Source file repositories/reference/linux-study-clean/fs/ext4/file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ext4/file.c- Extension
.c- Size
- 27182 bytes
- Lines
- 1008
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/time.hlinux/fs.hlinux/iomap.hlinux/mount.hlinux/path.hlinux/dax.hlinux/filelock.hlinux/quotaops.hlinux/uio.hlinux/mman.hlinux/backing-dev.hext4.hext4_jbd2.hxattr.hacl.htruncate.h
Detected Declarations
function ext4_should_use_diofunction ext4_dio_read_iterfunction ext4_dax_read_iterfunction ext4_file_read_iterfunction ext4_file_splice_readfunction ext4_release_filefunction ext4_unaligned_iofunction ext4_extending_iofunction ext4_overwrite_iofunction ext4_generic_write_checksfunction ext4_write_checksfunction ext4_buffered_write_iterfunction ext4_handle_inode_extensionfunction ext4_handle_inode_extensionfunction ext4_handle_inode_extensionfunction ext4_dio_write_end_iofunction ext4_dio_write_checksfunction file_modifiedfunction ext4_dio_write_iterfunction ext4_dax_write_iterfunction ext4_file_write_iterfunction ext4_dax_huge_faultfunction ext4_dax_faultfunction ext4_file_mmap_preparefunction ext4_sample_last_mountedfunction ext4_file_openfunction ext4_llseek
Annotated Snippet
const struct file_operations ext4_file_operations = {
.llseek = ext4_llseek,
.read_iter = ext4_file_read_iter,
.write_iter = ext4_file_write_iter,
.iopoll = iocb_bio_iopoll,
.unlocked_ioctl = ext4_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ext4_compat_ioctl,
#endif
.mmap_prepare = ext4_file_mmap_prepare,
.open = ext4_file_open,
.release = ext4_release_file,
.fsync = ext4_sync_file,
.get_unmapped_area = thp_get_unmapped_area,
.splice_read = ext4_file_splice_read,
.splice_write = iter_file_splice_write,
.fallocate = ext4_fallocate,
.fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
FOP_DIO_PARALLEL_WRITE |
FOP_DONTCACHE,
.setlease = generic_setlease,
};
const struct inode_operations ext4_file_inode_operations = {
.setattr = ext4_setattr,
.getattr = ext4_file_getattr,
.listxattr = ext4_listxattr,
.get_inode_acl = ext4_get_acl,
.set_acl = ext4_set_acl,
.fiemap = ext4_fiemap,
.fileattr_get = ext4_fileattr_get,
.fileattr_set = ext4_fileattr_set,
};
Annotation
- Immediate include surface: `linux/time.h`, `linux/fs.h`, `linux/iomap.h`, `linux/mount.h`, `linux/path.h`, `linux/dax.h`, `linux/filelock.h`, `linux/quotaops.h`.
- Detected declarations: `function ext4_should_use_dio`, `function ext4_dio_read_iter`, `function ext4_dax_read_iter`, `function ext4_file_read_iter`, `function ext4_file_splice_read`, `function ext4_release_file`, `function ext4_unaligned_io`, `function ext4_extending_io`, `function ext4_overwrite_io`, `function ext4_generic_write_checks`.
- 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.