fs/ntfs3/file.c
Source file repositories/reference/linux-study-clean/fs/ntfs3/file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ntfs3/file.c- Extension
.c- Size
- 36361 bytes
- Lines
- 1599
- 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/backing-dev.hlinux/blkdev.hlinux/buffer_head.hlinux/compat.hlinux/falloc.hlinux/fiemap.hlinux/fileattr.hlinux/filelock.hlinux/iomap.hdebug.hntfs.hntfs_fs.h
Detected Declarations
function Copyrightfunction ntfs_should_use_diofunction ntfs_ioctl_fitrimfunction ntfs_ioctl_get_volume_labelfunction ntfs_ioctl_set_volume_labelfunction ntfs_force_shutdownfunction ntfs_ioctl_shutdownfunction ntfs_ioctlfunction ntfs_compat_ioctlfunction ntfs_fileattr_getfunction ntfs_getattrfunction ntfs_extend_initialized_sizefunction ntfs_filemap_closefunction ntfs_file_mmap_preparefunction ntfs_extendfunction ntfs_truncatefunction ntfs_fallocatefunction ntfs_set_statefunction ntfs_setattrfunction check_read_restrictionfunction ntfs_file_read_iterfunction ntfs_file_splice_readfunction ntfs_get_frame_pagesfunction ntfs_compress_writefunction check_write_restrictionfunction ntfs_file_write_iterfunction ntfs_file_openfunction ntfs_file_releasefunction ntfs_fiemapfunction ntfs_file_splice_writefunction ntfs_file_fsyncfunction ntfs_llseek
Annotated Snippet
const struct file_operations ntfs_file_operations = {
.llseek = ntfs_llseek,
.read_iter = ntfs_file_read_iter,
.write_iter = ntfs_file_write_iter,
.unlocked_ioctl = ntfs_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ntfs_compat_ioctl,
#endif
.splice_read = ntfs_file_splice_read,
.splice_write = ntfs_file_splice_write,
.mmap_prepare = ntfs_file_mmap_prepare,
.open = ntfs_file_open,
.fsync = ntfs_file_fsync,
.fallocate = ntfs_fallocate,
.release = ntfs_file_release,
.setlease = generic_setlease,
};
// clang-format on
Annotation
- Immediate include surface: `linux/backing-dev.h`, `linux/blkdev.h`, `linux/buffer_head.h`, `linux/compat.h`, `linux/falloc.h`, `linux/fiemap.h`, `linux/fileattr.h`, `linux/filelock.h`.
- Detected declarations: `function Copyright`, `function ntfs_should_use_dio`, `function ntfs_ioctl_fitrim`, `function ntfs_ioctl_get_volume_label`, `function ntfs_ioctl_set_volume_label`, `function ntfs_force_shutdown`, `function ntfs_ioctl_shutdown`, `function ntfs_ioctl`, `function ntfs_compat_ioctl`, `function ntfs_fileattr_get`.
- 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.