drivers/infiniband/core/restrack.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/core/restrack.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/core/restrack.c- Extension
.c- Size
- 8971 bytes
- Lines
- 364
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
rdma/rdma_cm.hrdma/ib_verbs.hrdma/restrack.hrdma/rdma_counter.hlinux/mutex.hlinux/sched/task.hlinux/pid_namespace.hcma_priv.hrestrack.h
Detected Declarations
function Copyrightfunction rdma_restrack_cleanfunction rdma_restrack_countfunction rdma_restrack_attach_taskfunction rdma_restrack_set_namefunction rdma_restrack_parent_namefunction rdma_restrack_newfunction rdma_restrack_addfunction rdma_restrack_getfunction rdma_restrack_get_byidfunction restrack_releasefunction rdma_restrack_putfunction rdma_restrack_syncfunction rdma_restrack_delexport rdma_restrack_countexport rdma_restrack_set_nameexport rdma_restrack_parent_nameexport rdma_restrack_newexport rdma_restrack_addexport rdma_restrack_getexport rdma_restrack_get_byidexport rdma_restrack_putexport rdma_restrack_syncexport rdma_restrack_del
Annotated Snippet
if (res->task) {
put_task_struct(res->task);
res->task = NULL;
}
return;
}
if (res->no_track)
goto out;
dev = res_to_dev(res);
if (WARN_ON(!dev))
return;
rt = &dev->res[res->type];
old = xa_erase(&rt->xa, res->id);
WARN_ON(old != res);
out:
res->valid = false;
rdma_restrack_put(res);
wait_for_completion(&res->comp);
}
EXPORT_SYMBOL(rdma_restrack_del);
Annotation
- Immediate include surface: `rdma/rdma_cm.h`, `rdma/ib_verbs.h`, `rdma/restrack.h`, `rdma/rdma_counter.h`, `linux/mutex.h`, `linux/sched/task.h`, `linux/pid_namespace.h`, `cma_priv.h`.
- Detected declarations: `function Copyright`, `function rdma_restrack_clean`, `function rdma_restrack_count`, `function rdma_restrack_attach_task`, `function rdma_restrack_set_name`, `function rdma_restrack_parent_name`, `function rdma_restrack_new`, `function rdma_restrack_add`, `function rdma_restrack_get`, `function rdma_restrack_get_byid`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: integration implementation candidate.
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.