lib/memregion.c
Source file repositories/reference/linux-study-clean/lib/memregion.c
File Facts
- System
- Linux kernel
- Corpus path
lib/memregion.c- Extension
.c- Size
- 429 bytes
- Lines
- 20
- Domain
- Kernel Services
- Bucket
- lib
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
Dependency Surface
linux/idr.hlinux/types.hlinux/memregion.h
Detected Declarations
function memregion_allocfunction memregion_freeexport memregion_allocexport memregion_free
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* identifiers for device / performance-differentiated memory regions */
#include <linux/idr.h>
#include <linux/types.h>
#include <linux/memregion.h>
static DEFINE_IDA(memregion_ids);
int memregion_alloc(gfp_t gfp)
{
return ida_alloc(&memregion_ids, gfp);
}
EXPORT_SYMBOL(memregion_alloc);
void memregion_free(int id)
{
ida_free(&memregion_ids, id);
}
EXPORT_SYMBOL(memregion_free);
Annotation
- Immediate include surface: `linux/idr.h`, `linux/types.h`, `linux/memregion.h`.
- Detected declarations: `function memregion_alloc`, `function memregion_free`, `export memregion_alloc`, `export memregion_free`.
- Atlas domain: Kernel Services / lib.
- 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.