drivers/md/dm-cache-background-tracker.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-cache-background-tracker.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-cache-background-tracker.h- Extension
.h- Size
- 2553 bytes
- Lines
- 89
- 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.
- 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/vmalloc.hdm-cache-policy.h
Detected Declarations
struct bt_workstruct background_workstruct background_tracker
Annotated Snippet
struct bt_work {
struct list_head list;
struct rb_node node;
struct policy_work work;
};
extern struct kmem_cache *btracker_work_cache;
struct background_work;
struct background_tracker;
/*
* Create a new tracker, it will not be able to queue more than
* 'max_work' entries.
*/
struct background_tracker *btracker_create(unsigned int max_work);
/*
* Destroy the tracker. No issued, but not complete, work should
* exist when this is called. It is fine to have queued but unissued
* work.
*/
void btracker_destroy(struct background_tracker *b);
unsigned int btracker_nr_demotions_queued(struct background_tracker *b);
/*
* Queue some work within the tracker. 'work' should point to the work
* to queue, this will be copied (ownership doesn't pass). If pwork
* is not NULL then it will be set to point to the tracker's internal
* copy of the work.
*
* returns -EINVAL iff the work is already queued. -ENOMEM if the work
* couldn't be queued for another reason.
*/
int btracker_queue(struct background_tracker *b,
struct policy_work *work,
struct policy_work **pwork);
/*
* Hands out the next piece of work to be performed.
* Returns -ENODATA if there's no work.
*/
int btracker_issue(struct background_tracker *b, struct policy_work **work);
/*
* Informs the tracker that the work has been completed and it may forget
* about it.
*/
void btracker_complete(struct background_tracker *b, struct policy_work *op);
/*
* Predicate to see if an origin block is already scheduled for promotion.
*/
bool btracker_promotion_already_present(struct background_tracker *b,
dm_oblock_t oblock);
/*----------------------------------------------------------------*/
#endif
Annotation
- Immediate include surface: `linux/vmalloc.h`, `dm-cache-policy.h`.
- Detected declarations: `struct bt_work`, `struct background_work`, `struct background_tracker`.
- Atlas domain: Driver Families / drivers/md.
- 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.