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.

Dependency Surface

Detected Declarations

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

Implementation Notes