drivers/dma-buf/sw_sync.c
Source file repositories/reference/linux-study-clean/drivers/dma-buf/sw_sync.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma-buf/sw_sync.c- Extension
.c- Size
- 11232 bytes
- Lines
- 486
- Domain
- Driver Families
- Bucket
- drivers/dma-buf
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/file.hlinux/fs.hlinux/uaccess.hlinux/panic.hlinux/slab.hlinux/sync_file.hsync_debug.hsync_trace.h
Detected Declarations
struct sw_sync_create_fence_datastruct sw_sync_get_deadlinefunction sync_timeline_createfunction sync_timeline_freefunction sync_timeline_getfunction sync_timeline_putfunction timeline_fence_releasefunction timeline_fence_signaledfunction timeline_fence_set_deadlinefunction sync_timeline_signalfunction list_for_each_entry_safefunction list_for_each_entry_safefunction sync_pt_createfunction sw_sync_debugfs_openfunction sw_sync_debugfs_releasefunction list_for_each_entry_safefunction sw_sync_ioctl_create_fencefunction sw_sync_ioctl_incfunction sw_sync_ioctl_get_deadlinefunction sw_sync_ioctl
Annotated Snippet
const struct file_operations sw_sync_debugfs_fops = {
.open = sw_sync_debugfs_open,
.release = sw_sync_debugfs_release,
.unlocked_ioctl = sw_sync_ioctl,
.compat_ioctl = compat_ptr_ioctl,
};
Annotation
- Immediate include surface: `linux/file.h`, `linux/fs.h`, `linux/uaccess.h`, `linux/panic.h`, `linux/slab.h`, `linux/sync_file.h`, `sync_debug.h`, `sync_trace.h`.
- Detected declarations: `struct sw_sync_create_fence_data`, `struct sw_sync_get_deadline`, `function sync_timeline_create`, `function sync_timeline_free`, `function sync_timeline_get`, `function sync_timeline_put`, `function timeline_fence_release`, `function timeline_fence_signaled`, `function timeline_fence_set_deadline`, `function sync_timeline_signal`.
- Atlas domain: Driver Families / drivers/dma-buf.
- 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.