drivers/nvdimm/pmem.h
Source file repositories/reference/linux-study-clean/drivers/nvdimm/pmem.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/nvdimm/pmem.h- Extension
.h- Size
- 1221 bytes
- Lines
- 46
- 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/page-flags.hlinux/badblocks.hlinux/memremap.hlinux/types.hlinux/fs.h
Detected Declarations
struct pmem_deviceenum dax_access_modefunction test_and_clear_pmem_poisonfunction test_and_clear_pmem_poison
Annotated Snippet
struct pmem_device {
/* One contiguous memory region per device */
phys_addr_t phys_addr;
/* when non-zero this device is hosting a 'pfn' instance */
phys_addr_t data_offset;
void *virt_addr;
/* immutable base size of the namespace */
size_t size;
/* trim size when namespace capacity has been section aligned */
u32 pfn_pad;
struct kernfs_node *bb_state;
struct badblocks bb;
struct dax_device *dax_dev;
struct gendisk *disk;
struct dev_pagemap pgmap;
};
long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
long nr_pages, enum dax_access_mode mode, void **kaddr,
unsigned long *pfn);
#ifdef CONFIG_MEMORY_FAILURE
static inline bool test_and_clear_pmem_poison(struct page *page)
{
return TestClearPageHWPoison(page);
}
#else
static inline bool test_and_clear_pmem_poison(struct page *page)
{
return false;
}
#endif
#endif /* __NVDIMM_PMEM_H__ */
Annotation
- Immediate include surface: `linux/page-flags.h`, `linux/badblocks.h`, `linux/memremap.h`, `linux/types.h`, `linux/fs.h`.
- Detected declarations: `struct pmem_device`, `enum dax_access_mode`, `function test_and_clear_pmem_poison`, `function test_and_clear_pmem_poison`.
- 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.