drivers/pci/hotplug/cpqphp_sysfs.c
Source file repositories/reference/linux-study-clean/drivers/pci/hotplug/cpqphp_sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/hotplug/cpqphp_sysfs.c- Extension
.c- Size
- 4824 bytes
- Lines
- 208
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/module.hlinux/kernel.hlinux/slab.hlinux/types.hlinux/proc_fs.hlinux/workqueue.hlinux/pci.hlinux/pci_hotplug.hlinux/mutex.hlinux/debugfs.hcpqphp.h
Detected Declarations
struct ctrl_dbgfunction show_ctrlfunction show_devfunction spew_debug_infofunction openfunction lseekfunction readfunction releasefunction cpqhp_initialize_debugfsfunction cpqhp_shutdown_debugfsfunction cpqhp_create_debugfs_filesfunction cpqhp_remove_debugfs_files
Annotated Snippet
static const struct file_operations debug_ops = {
.owner = THIS_MODULE,
.open = open,
.llseek = lseek,
.read = read,
.release = release,
};
static struct dentry *root;
void cpqhp_initialize_debugfs(void)
{
if (!root)
root = debugfs_create_dir("cpqhp", NULL);
}
void cpqhp_shutdown_debugfs(void)
{
debugfs_remove(root);
}
void cpqhp_create_debugfs_files(struct controller *ctrl)
{
ctrl->dentry = debugfs_create_file(dev_name(&ctrl->pci_dev->dev),
S_IRUGO, root, ctrl, &debug_ops);
}
void cpqhp_remove_debugfs_files(struct controller *ctrl)
{
debugfs_remove(ctrl->dentry);
ctrl->dentry = NULL;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/slab.h`, `linux/types.h`, `linux/proc_fs.h`, `linux/workqueue.h`, `linux/pci.h`, `linux/pci_hotplug.h`.
- Detected declarations: `struct ctrl_dbg`, `function show_ctrl`, `function show_dev`, `function spew_debug_info`, `function open`, `function lseek`, `function read`, `function release`, `function cpqhp_initialize_debugfs`, `function cpqhp_shutdown_debugfs`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: pattern implementation candidate.
- 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.