fs/eventfd.c
Source file repositories/reference/linux-study-clean/fs/eventfd.c
File Facts
- System
- Linux kernel
- Corpus path
fs/eventfd.c- Extension
.c- Size
- 11424 bytes
- Lines
- 424
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- 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.
- 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/file.hlinux/poll.hlinux/init.hlinux/fs.hlinux/sched/signal.hlinux/kernel.hlinux/slab.hlinux/list.hlinux/spinlock.hlinux/anon_inodes.hlinux/syscalls.hlinux/export.hlinux/kref.hlinux/eventfd.hlinux/proc_fs.hlinux/seq_file.hlinux/idr.hlinux/uio.h
Detected Declarations
syscall eventfd2syscall eventfdstruct eventfd_ctxfunction pollfunction eventfd_free_ctxfunction eventfd_freefunction eventfd_ctx_fdgetfunction eventfd_releasefunction eventfd_pollfunction eventfd_ctx_do_readfunction eventfd_ctx_remove_wait_queuefunction eventfd_readfunction eventfd_writefunction eventfd_show_fdinfofunction do_eventfdexport eventfd_signal_maskexport eventfd_ctx_putexport eventfd_ctx_do_readexport eventfd_ctx_remove_wait_queueexport eventfd_fgetexport eventfd_ctx_fdgetexport eventfd_ctx_fileget
Annotated Snippet
SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
{
return do_eventfd(count, flags);
}
SYSCALL_DEFINE1(eventfd, unsigned int, count)
{
return do_eventfd(count, 0);
}
Annotation
- Immediate include surface: `linux/file.h`, `linux/poll.h`, `linux/init.h`, `linux/fs.h`, `linux/sched/signal.h`, `linux/kernel.h`, `linux/slab.h`, `linux/list.h`.
- Detected declarations: `syscall eventfd2`, `syscall eventfd`, `struct eventfd_ctx`, `function poll`, `function eventfd_free_ctx`, `function eventfd_free`, `function eventfd_ctx_fdget`, `function eventfd_release`, `function eventfd_poll`, `function eventfd_ctx_do_read`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: core 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.