drivers/md/dm-pcache/dm_pcache.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-pcache/dm_pcache.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-pcache/dm_pcache.h- Extension
.h- Size
- 1871 bytes
- Lines
- 68
- Domain
- Driver Families
- Bucket
- drivers/md
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device-mapper.h../dm-core.h
Detected Declarations
struct pcache_cache_devstruct pcache_backing_devstruct pcache_cachestruct pcache_cache_optionsstruct dm_pcachestruct pcache_requestfunction pcache_is_stopping
Annotated Snippet
struct dm_pcache {
struct dm_target *ti;
struct pcache_cache_dev cache_dev;
struct pcache_backing_dev backing_dev;
struct pcache_cache cache;
struct pcache_cache_options opts;
spinlock_t defered_req_list_lock;
struct list_head defered_req_list;
struct workqueue_struct *task_wq;
struct work_struct defered_req_work;
atomic_t state;
atomic_t inflight_reqs;
wait_queue_head_t inflight_wq;
};
static inline bool pcache_is_stopping(struct dm_pcache *pcache)
{
return (atomic_read(&pcache->state) == PCACHE_STATE_STOPPING);
}
#define pcache_dev_err(pcache, fmt, ...) \
pcache_err("%s " fmt, pcache->ti->table->md->name, ##__VA_ARGS__)
#define pcache_dev_info(pcache, fmt, ...) \
pcache_info("%s " fmt, pcache->ti->table->md->name, ##__VA_ARGS__)
#define pcache_dev_debug(pcache, fmt, ...) \
pcache_debug("%s " fmt, pcache->ti->table->md->name, ##__VA_ARGS__)
struct pcache_request {
struct dm_pcache *pcache;
struct bio *bio;
u64 off;
u32 data_len;
struct kref ref;
int ret;
struct list_head list_node;
};
void pcache_req_get(struct pcache_request *pcache_req);
void pcache_req_put(struct pcache_request *pcache_req, int ret);
void pcache_defer_reqs_kick(struct dm_pcache *pcache);
#endif /* _DM_PCACHE_H */
Annotation
- Immediate include surface: `linux/device-mapper.h`, `../dm-core.h`.
- Detected declarations: `struct pcache_cache_dev`, `struct pcache_backing_dev`, `struct pcache_cache`, `struct pcache_cache_options`, `struct dm_pcache`, `struct pcache_request`, `function pcache_is_stopping`.
- Atlas domain: Driver Families / drivers/md.
- Implementation status: source 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.