kernel/relay.c
Source file repositories/reference/linux-study-clean/kernel/relay.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/relay.c- Extension
.c- Size
- 24497 bytes
- Lines
- 1013
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- 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/errno.hlinux/stddef.hlinux/slab.hlinux/export.hlinux/string.hlinux/relay.hlinux/vmalloc.hlinux/mm.hlinux/cpu.hlinux/splice.h
Detected Declarations
struct rchan_percpu_buf_dispatcherfunction faultfunction relay_free_page_arrayfunction relay_mmap_prepare_buffunction kref_putfunction relay_destroy_buffunction kref_putfunction relay_buf_emptyfunction relay_buf_fullfunction relay_subbuf_startfunction wakeup_readersfunction relay_resetfunction relay_resetfunction relay_set_buf_dentryfunction relay_openfunction relay_close_buffunction relay_prepare_cpufunction relay_switch_subbuffunction relay_subbufs_consumedfunction relay_closefunction relay_flushfunction relay_statsfunction for_each_online_cpufunction relay_file_openfunction relay_mmap_prepare_buffunction relay_file_pollfunction relay_file_releasefunction relay_file_read_consumefunction relay_file_read_availfunction relay_file_read_subbuf_availfunction relay_file_read_start_posfunction relay_file_read_end_posfunction relay_file_readexport relay_buf_fullexport relay_resetexport relay_openexport relay_switch_subbufexport relay_subbufs_consumedexport relay_closeexport relay_flushexport relay_file_operations
Annotated Snippet
const struct file_operations relay_file_operations = {
.open = relay_file_open,
.poll = relay_file_poll,
.mmap_prepare = relay_file_mmap_prepare,
.read = relay_file_read,
.release = relay_file_release,
};
EXPORT_SYMBOL_GPL(relay_file_operations);
Annotation
- Immediate include surface: `linux/errno.h`, `linux/stddef.h`, `linux/slab.h`, `linux/export.h`, `linux/string.h`, `linux/relay.h`, `linux/vmalloc.h`, `linux/mm.h`.
- Detected declarations: `struct rchan_percpu_buf_dispatcher`, `function fault`, `function relay_free_page_array`, `function relay_mmap_prepare_buf`, `function kref_put`, `function relay_destroy_buf`, `function kref_put`, `function relay_buf_empty`, `function relay_buf_full`, `function relay_subbuf_start`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- 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.