fs/ntfs/file.c
Source file repositories/reference/linux-study-clean/fs/ntfs/file.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ntfs/file.c- Extension
.c- Size
- 29924 bytes
- Lines
- 1190
- 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/writeback.hlinux/blkdev.hlinux/fs.hlinux/iomap.hlinux/uio.hlinux/posix_acl.hlinux/posix_acl_xattr.hlinux/compat.hlinux/falloc.hlcnalloc.hntfs.hreparse.hea.hiomap.hbitmap.hvolume.hlinux/filelock.h
Detected Declarations
function Copyrightfunction setfunction ntfs_file_releasefunction recordsfunction ntfs_setattr_sizefunction notify_changefunction ntfs_getattrfunction ntfs_file_llseekfunction ntfs_file_read_iterfunction ntfs_file_write_dio_end_iofunction ntfs_dio_write_iterfunction ntfs_file_write_iterfunction ntfs_filemap_page_mkwritefunction ntfs_file_mmap_preparefunction ntfs_fiemapfunction ntfs_file_splice_readfunction ntfs_ioctl_shutdownfunction ntfs_ioctl_get_volume_labelfunction ntfs_ioctl_set_volume_labelfunction ntfs_ioctl_fitrimfunction ntfs_ioctlfunction ntfs_compat_ioctlfunction ntfs_allocate_rangefunction atomic64_readfunction ntfs_punch_holefunction ntfs_collapse_rangefunction ntfs_insert_rangefunction ntfs_fallocate
Annotated Snippet
const struct file_operations ntfs_file_ops = {
.llseek = ntfs_file_llseek,
.read_iter = ntfs_file_read_iter,
.write_iter = ntfs_file_write_iter,
.fsync = ntfs_file_fsync,
.mmap_prepare = ntfs_file_mmap_prepare,
.open = ntfs_file_open,
.release = ntfs_file_release,
.splice_read = ntfs_file_splice_read,
.splice_write = iter_file_splice_write,
.unlocked_ioctl = ntfs_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ntfs_compat_ioctl,
#endif
.fallocate = ntfs_fallocate,
.setlease = generic_setlease,
};
const struct inode_operations ntfs_file_inode_ops = {
.setattr = ntfs_setattr,
.getattr = ntfs_getattr,
.listxattr = ntfs_listxattr,
.get_acl = ntfs_get_acl,
.set_acl = ntfs_set_acl,
.fiemap = ntfs_fiemap,
};
const struct inode_operations ntfs_symlink_inode_operations = {
.get_link = ntfs_get_link,
.setattr = ntfs_setattr,
.listxattr = ntfs_listxattr,
};
const struct inode_operations ntfs_special_inode_operations = {
.setattr = ntfs_setattr,
.getattr = ntfs_getattr,
.listxattr = ntfs_listxattr,
.get_acl = ntfs_get_acl,
.set_acl = ntfs_set_acl,
};
const struct file_operations ntfs_empty_file_ops = {};
const struct inode_operations ntfs_empty_inode_ops = {};
Annotation
- Immediate include surface: `linux/writeback.h`, `linux/blkdev.h`, `linux/fs.h`, `linux/iomap.h`, `linux/uio.h`, `linux/posix_acl.h`, `linux/posix_acl_xattr.h`, `linux/compat.h`.
- Detected declarations: `function Copyright`, `function set`, `function ntfs_file_release`, `function records`, `function ntfs_setattr_size`, `function notify_change`, `function ntfs_getattr`, `function ntfs_file_llseek`, `function ntfs_file_read_iter`, `function ntfs_file_write_dio_end_io`.
- 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.