fs/xfs/xfs_file.c
Source file repositories/reference/linux-study-clean/fs/xfs/xfs_file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/xfs/xfs_file.c- Extension
.c- Size
- 56499 bytes
- Lines
- 2121
- 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
xfs_platform.hxfs_fs.hxfs_shared.hxfs_format.hxfs_log_format.hxfs_trans_resv.hxfs_mount.hxfs_inode.hxfs_trans.hxfs_inode_item.hxfs_bmap.hxfs_bmap_util.hxfs_dir2.hxfs_dir2_priv.hxfs_ioctl.hxfs_trace.hxfs_log.hxfs_icache.hxfs_pnfs.hxfs_iomap.hxfs_reflink.hxfs_file.hxfs_aops.hxfs_zone_alloc.hxfs_error.hxfs_errortag.hlinux/dax.hlinux/falloc.hlinux/backing-dev.hlinux/mman.hlinux/fadvise.hlinux/mount.h
Detected Declarations
function xfs_is_falloc_alignedfunction xfs_dir_fsyncfunction xfs_log_force_seqfunction xfs_file_fsyncfunction xfs_ilock_iocbfunction xfs_ilock_iocb_for_writefunction xfs_iflags_testfunction xfs_dio_read_bounce_submit_iofunction xfs_file_dio_readfunction xfs_file_dax_readfunction xfs_file_buffered_readfunction xfs_file_read_iterfunction xfs_file_splice_readfunction xfs_file_write_zero_eoffunction xfs_file_write_checksfunction file_remove_privsfunction xfs_zoned_write_space_reservefunction xfs_dio_endio_set_isizefunction xfs_zoned_dio_write_end_iofunction xfs_dio_write_end_iofunction xfs_dio_zoned_submit_iofunction xfs_file_dio_write_alignedfunction xfs_file_write_checksfunction xfs_file_dio_write_zonedfunction xfs_file_dio_write_atomicfunction xfs_file_dio_write_unalignedfunction xfs_file_dio_writefunction xfs_file_dax_writefunction xfs_file_buffered_writefunction xfs_file_buffered_write_zonedfunction xfs_file_write_iterfunction xfs_file_sync_writesfunction xfs_falloc_newsizefunction xfs_falloc_setsizefunction xfs_falloc_collapse_rangefunction xfs_falloc_insert_rangefunction xfs_falloc_force_zerofunction xfs_falloc_zero_rangefunction xfs_falloc_unshare_rangefunction xfs_falloc_allocate_rangefunction __xfs_file_fallocatefunction xfs_file_zoned_fallocatefunction xfs_file_fallocatefunction xfs_file_fadvisefunction xfs_file_remap_rangefunction xfs_file_openfunction xfs_dir_openfunction xfs_file_release
Annotated Snippet
const struct file_operations xfs_file_operations = {
.llseek = xfs_file_llseek,
.read_iter = xfs_file_read_iter,
.write_iter = xfs_file_write_iter,
.splice_read = xfs_file_splice_read,
.splice_write = iter_file_splice_write,
.iopoll = iocb_bio_iopoll,
.unlocked_ioctl = xfs_file_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = xfs_file_compat_ioctl,
#endif
.mmap_prepare = xfs_file_mmap_prepare,
.open = xfs_file_open,
.release = xfs_file_release,
.fsync = xfs_file_fsync,
.get_unmapped_area = thp_get_unmapped_area,
.fallocate = xfs_file_fallocate,
.fadvise = xfs_file_fadvise,
.remap_file_range = xfs_file_remap_range,
.fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE |
FOP_DONTCACHE,
.setlease = generic_setlease,
};
const struct file_operations xfs_dir_file_operations = {
.open = xfs_dir_open,
.read = generic_read_dir,
.iterate_shared = xfs_file_readdir,
.llseek = generic_file_llseek,
.unlocked_ioctl = xfs_file_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = xfs_file_compat_ioctl,
#endif
.fsync = xfs_dir_fsync,
.setlease = generic_setlease,
};
Annotation
- Immediate include surface: `xfs_platform.h`, `xfs_fs.h`, `xfs_shared.h`, `xfs_format.h`, `xfs_log_format.h`, `xfs_trans_resv.h`, `xfs_mount.h`, `xfs_inode.h`.
- Detected declarations: `function xfs_is_falloc_aligned`, `function xfs_dir_fsync`, `function xfs_log_force_seq`, `function xfs_file_fsync`, `function xfs_ilock_iocb`, `function xfs_ilock_iocb_for_write`, `function xfs_iflags_test`, `function xfs_dio_read_bounce_submit_io`, `function xfs_file_dio_read`, `function xfs_file_dax_read`.
- 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.