drivers/nvdimm/region.c
Source file repositories/reference/linux-study-clean/drivers/nvdimm/region.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nvdimm/region.c- Extension
.c- Size
- 4375 bytes
- Lines
- 164
- Domain
- Driver Families
- Bucket
- drivers/nvdimm
- Inferred role
- Driver Families: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/memregion.hlinux/cpumask.hlinux/module.hlinux/device.hlinux/nd.hnd-core.hnd.h
Detected Declarations
function Copyrightfunction child_unregisterfunction nd_region_removefunction child_notifyfunction nd_region_notifyfunction nd_region_initfunction nd_region_exit
Annotated Snippet
if (is_memory(&nd_region->dev)) {
struct range range = {
.start = nd_region->ndr_start,
.end = nd_region->ndr_start +
nd_region->ndr_size - 1,
};
nvdimm_badblocks_populate(nd_region,
&nd_region->bb, &range);
if (nd_region->bb_state)
sysfs_notify_dirent(nd_region->bb_state);
}
}
device_for_each_child(dev, &event, child_notify);
}
static struct nd_device_driver nd_region_driver = {
.probe = nd_region_probe,
.remove = nd_region_remove,
.notify = nd_region_notify,
.drv = {
.name = "nd_region",
},
.type = ND_DRIVER_REGION_BLK | ND_DRIVER_REGION_PMEM,
};
int __init nd_region_init(void)
{
return nd_driver_register(&nd_region_driver);
}
void nd_region_exit(void)
{
driver_unregister(&nd_region_driver.drv);
}
MODULE_ALIAS_ND_DEVICE(ND_DEVICE_REGION_PMEM);
Annotation
- Immediate include surface: `linux/memregion.h`, `linux/cpumask.h`, `linux/module.h`, `linux/device.h`, `linux/nd.h`, `nd-core.h`, `nd.h`.
- Detected declarations: `function Copyright`, `function child_unregister`, `function nd_region_remove`, `function child_notify`, `function nd_region_notify`, `function nd_region_init`, `function nd_region_exit`.
- Atlas domain: Driver Families / drivers/nvdimm.
- Implementation status: source 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.