fs/f2fs/file.c
Source file repositories/reference/linux-study-clean/fs/f2fs/file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/f2fs/file.c- Extension
.c- Size
- 135586 bytes
- Lines
- 5492
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/blk-crypto.hlinux/fs.hlinux/f2fs_fs.hlinux/stat.hlinux/writeback.hlinux/blkdev.hlinux/falloc.hlinux/filelock.hlinux/types.hlinux/compat.hlinux/uaccess.hlinux/mount.hlinux/uio.hlinux/uuid.hlinux/file.hlinux/nls.hlinux/sched/signal.hlinux/fileattr.hlinux/fadvise.hlinux/iomap.hf2fs.hnode.hsegment.hxattr.hacl.hgc.hiostat.htrace/events/f2fs.huapi/linux/f2fs.h
Detected Declarations
struct compat_f2fs_gc_rangestruct compat_f2fs_move_rangefunction Copyrightfunction f2fs_filemap_faultfunction f2fs_vm_page_mkwritefunction mapping_large_folio_supportfunction folio_posfunction i_size_readfunction get_parent_inofunction need_do_checkpointfunction need_inode_page_updatefunction try_to_fix_pinofunction get_parent_inofunction f2fs_do_sync_filefunction f2fs_sync_filefunction __found_offsetfunction f2fs_seek_blockfunction f2fs_llseekfunction f2fs_file_mmap_preparefunction finish_preallocate_blocksfunction f2fs_file_openfunction f2fs_truncate_data_blocks_rangefunction truncate_partial_data_pagefunction f2fs_do_truncate_blocksfunction f2fs_truncate_blocksfunction f2fs_truncatefunction f2fs_force_buffered_iofunction f2fs_getattrfunction __setattr_copyfunction f2fs_setattrfunction i_gid_needs_updatefunction fill_zerofunction f2fs_truncate_holefunction f2fs_punch_holefunction __read_out_blkaddrsfunction __roll_back_blkaddrsfunction __clone_blkaddrsfunction __exchange_data_blockfunction f2fs_do_collapsefunction f2fs_collapse_rangefunction f2fs_do_zero_rangefunction f2fs_zero_rangefunction f2fs_insert_rangefunction f2fs_expand_inode_datafunction f2fs_fallocatefunction f2fs_release_filefunction f2fs_file_flushfunction f2fs_setflags_common
Annotated Snippet
const struct file_operations f2fs_file_operations = {
.llseek = f2fs_llseek,
.read_iter = f2fs_file_read_iter,
.write_iter = f2fs_file_write_iter,
.iopoll = iocb_bio_iopoll,
.open = f2fs_file_open,
.release = f2fs_release_file,
.mmap_prepare = f2fs_file_mmap_prepare,
.flush = f2fs_file_flush,
.fsync = f2fs_sync_file,
.fallocate = f2fs_fallocate,
.unlocked_ioctl = f2fs_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = f2fs_compat_ioctl,
#endif
.splice_read = f2fs_file_splice_read,
.splice_write = iter_file_splice_write,
.fadvise = f2fs_file_fadvise,
.fop_flags = FOP_BUFFER_RASYNC,
.setlease = generic_setlease,
};
Annotation
- Immediate include surface: `linux/blk-crypto.h`, `linux/fs.h`, `linux/f2fs_fs.h`, `linux/stat.h`, `linux/writeback.h`, `linux/blkdev.h`, `linux/falloc.h`, `linux/filelock.h`.
- Detected declarations: `struct compat_f2fs_gc_range`, `struct compat_f2fs_move_range`, `function Copyright`, `function f2fs_filemap_fault`, `function f2fs_vm_page_mkwrite`, `function mapping_large_folio_support`, `function folio_pos`, `function i_size_read`, `function get_parent_ino`, `function need_do_checkpoint`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.