drivers/dax/dax-private.h
Source file repositories/reference/linux-study-clean/drivers/dax/dax-private.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/dax/dax-private.h- Extension
.h- Size
- 3874 bytes
- Lines
- 139
- Domain
- Driver Families
- Bucket
- drivers/dax
- 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/device.hlinux/cdev.hlinux/idr.h
Detected Declarations
struct dax_devicestruct dax_regionstruct dax_mappingstruct dev_dax_rangestruct dev_daxfunction dax_align_validfunction dax_align_valid
Annotated Snippet
struct dax_region {
int id;
int target_node;
struct kref kref;
struct device *dev;
unsigned int align;
struct ida ida;
struct resource res;
struct device *seed;
struct device *youngest;
};
/**
* struct dax_mapping - device to display mapping range attributes
* @dev: device representing this range
* @range_id: index within dev_dax ranges array
* @id: ida of this mapping
*/
struct dax_mapping {
struct device dev;
int range_id;
int id;
};
/**
* struct dev_dax_range - tuple represenging a range of memory used by dev_dax
* @pgoff: page offset
* @range: resource-span
* @mapping: reference to the dax_mapping for this range
*/
struct dev_dax_range {
unsigned long pgoff;
struct range range;
struct dax_mapping *mapping;
};
/**
* struct dev_dax - instance data for a subdivision of a dax region, and
* data while the device is activated in the driver.
* @region: parent region
* @dax_dev: core dax functionality
* @virt_addr: kva from memremap; used by fsdev_dax
* @cached_size: size of daxdev cached by fsdev_dax
* @align: alignment of this instance
* @target_node: effective numa node if dev_dax memory range is onlined
* @dyn_id: is this a dynamic or statically created instance
* @id: ida allocated id when the dax_region is not static
* @ida: mapping id allocator
* @dev: device core
* @pgmap: pgmap for memmap setup / lifetime (driver owned)
* @memmap_on_memory: allow kmem to put the memmap in the memory
* @nr_range: size of @ranges
* @ranges: range tuples of memory used
*/
struct dev_dax {
struct dax_region *region;
struct dax_device *dax_dev;
void *virt_addr;
u64 cached_size;
unsigned int align;
int target_node;
bool dyn_id;
int id;
struct ida ida;
struct device dev;
struct dev_pagemap *pgmap;
bool memmap_on_memory;
int nr_range;
struct dev_dax_range *ranges;
};
/*
* While run_dax() is potentially a generic operation that could be
* defined in include/linux/dax.h we don't want to grow any users
* outside of drivers/dax/
*/
void run_dax(struct dax_device *dax_dev);
static inline struct dev_dax *to_dev_dax(struct device *dev)
{
return container_of(dev, struct dev_dax, dev);
}
static inline struct dax_mapping *to_dax_mapping(struct device *dev)
{
return container_of(dev, struct dax_mapping, dev);
}
phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff, unsigned long size);
Annotation
- Immediate include surface: `linux/device.h`, `linux/cdev.h`, `linux/idr.h`.
- Detected declarations: `struct dax_device`, `struct dax_region`, `struct dax_mapping`, `struct dev_dax_range`, `struct dev_dax`, `function dax_align_valid`, `function dax_align_valid`.
- Atlas domain: Driver Families / drivers/dax.
- 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.