fs/ext2/file.c
Source file repositories/reference/linux-study-clean/fs/ext2/file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ext2/file.c- Extension
.c- Size
- 6184 bytes
- Lines
- 233
- 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/pagemap.hlinux/filelock.hlinux/quotaops.hlinux/iomap.hlinux/uio.hlinux/buffer_head.hext2.hxattr.hacl.htrace.h
Detected Declarations
function Copyrightfunction ext2_fsyncfunction ext2_dio_read_iterfunction ext2_dio_write_end_iofunction ext2_dio_write_iterfunction ext2_file_read_iterfunction ext2_file_write_iterfunction ext2_file_open
Annotated Snippet
const struct file_operations ext2_file_operations = {
.llseek = generic_file_llseek,
.read_iter = ext2_file_read_iter,
.write_iter = ext2_file_write_iter,
.unlocked_ioctl = ext2_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ext2_compat_ioctl,
#endif
.mmap_prepare = generic_file_mmap_prepare,
.open = ext2_file_open,
.release = ext2_release_file,
.fsync = ext2_fsync,
.get_unmapped_area = thp_get_unmapped_area,
.splice_read = filemap_splice_read,
.splice_write = iter_file_splice_write,
.setlease = generic_setlease,
};
const struct inode_operations ext2_file_inode_operations = {
.listxattr = ext2_listxattr,
.getattr = ext2_getattr,
.setattr = ext2_setattr,
.get_inode_acl = ext2_get_acl,
.set_acl = ext2_set_acl,
.fiemap = ext2_fiemap,
.fileattr_get = ext2_fileattr_get,
.fileattr_set = ext2_fileattr_set,
};
Annotation
- Immediate include surface: `linux/time.h`, `linux/pagemap.h`, `linux/filelock.h`, `linux/quotaops.h`, `linux/iomap.h`, `linux/uio.h`, `linux/buffer_head.h`, `ext2.h`.
- Detected declarations: `function Copyright`, `function ext2_fsync`, `function ext2_dio_read_iter`, `function ext2_dio_write_end_io`, `function ext2_dio_write_iter`, `function ext2_file_read_iter`, `function ext2_file_write_iter`, `function ext2_file_open`.
- 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.