mm/fadvise.c
Source file repositories/reference/linux-study-clean/mm/fadvise.c
File Facts
- System
- Linux kernel
- Corpus path
mm/fadvise.c- Extension
.c- Size
- 5616 bytes
- Lines
- 225
- Domain
- Core OS
- Bucket
- Memory Management
- Inferred role
- Core OS: syscall or user/kernel boundary
- Status
- core 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 or participates in a user/kernel boundary; inspect argument validation, copy_from_user/copy_to_user, credentials, and dispatch target.
- 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/kernel.hlinux/file.hlinux/fs.hlinux/mm.hlinux/pagemap.hlinux/backing-dev.hlinux/fadvise.hlinux/writeback.hlinux/syscalls.hlinux/swap.hasm/unistd.hinternal.h
Detected Declarations
syscall fadvise64_64syscall fadvise64function Copyrightfunction invalidate_mapping_pagesfunction vfs_fadvisefunction ksys_fadvise64_64function compat_arg_u64_dualexport generic_fadviseexport vfs_fadvise
Annotated Snippet
SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice)
{
return ksys_fadvise64_64(fd, offset, len, advice);
}
#ifdef __ARCH_WANT_SYS_FADVISE64
SYSCALL_DEFINE4(fadvise64, int, fd, loff_t, offset, size_t, len, int, advice)
{
return ksys_fadvise64_64(fd, offset, len, advice);
}
#endif
#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_FADVISE64_64)
COMPAT_SYSCALL_DEFINE6(fadvise64_64, int, fd, compat_arg_u64_dual(offset),
compat_arg_u64_dual(len), int, advice)
{
return ksys_fadvise64_64(fd, compat_arg_u64_glue(offset),
compat_arg_u64_glue(len), advice);
}
#endif
#endif
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/file.h`, `linux/fs.h`, `linux/mm.h`, `linux/pagemap.h`, `linux/backing-dev.h`, `linux/fadvise.h`, `linux/writeback.h`.
- Detected declarations: `syscall fadvise64_64`, `syscall fadvise64`, `function Copyright`, `function invalidate_mapping_pages`, `function vfs_fadvise`, `function ksys_fadvise64_64`, `function compat_arg_u64_dual`, `export generic_fadvise`, `export vfs_fadvise`.
- Atlas domain: Core OS / Memory Management.
- Implementation status: core 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.