drivers/md/dm-vdo/block-map.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/block-map.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/block-map.h- Extension
.h- Size
- 12879 bytes
- Lines
- 395
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hnumeric.hadmin-state.hcompletion.hencodings.hint-map.hstatistics.htypes.hvio.hwait-queue.h
Detected Declarations
struct vdo_page_cachestruct page_infostruct vdo_page_completionstruct foreststruct tree_pagestruct dirty_listsstruct block_map_zonestruct block_mapenum vdo_page_buffer_stateenum vdo_page_write_statusenum block_map_page_typefunction vdo_as_block_map_pagefunction vdo_convert_maximum_age
Annotated Snippet
struct vdo_page_cache {
/* the VDO which owns this cache */
struct vdo *vdo;
/* number of pages in cache */
page_count_t page_count;
/* number of pages to write in the current batch */
page_count_t pages_in_batch;
/* Whether the VDO is doing a read-only rebuild */
bool rebuilding;
/* array of page information entries */
struct page_info *infos;
/* raw memory for pages */
char *pages;
/* cache last found page info */
struct page_info *last_found;
/* map of page number to info */
struct int_map *page_map;
/* main LRU list (all infos) */
struct list_head lru_list;
/* free page list (oldest first) */
struct list_head free_list;
/* outgoing page list */
struct list_head outgoing_list;
/* number of read I/O operations pending */
page_count_t outstanding_reads;
/* number of write I/O operations pending */
page_count_t outstanding_writes;
/* number of pages covered by the current flush */
page_count_t pages_in_flush;
/* number of pages waiting to be included in the next flush */
page_count_t pages_to_flush;
/* number of discards in progress */
unsigned int discard_count;
/* how many VPCs waiting for free page */
unsigned int waiter_count;
/* queue of waiters who want a free page */
struct vdo_wait_queue free_waiters;
/*
* Statistics are only updated on the logical zone thread, but are accessed from other
* threads.
*/
struct block_map_statistics stats;
/* counter for pressure reports */
u32 pressure_report;
/* the block map zone to which this cache belongs */
struct block_map_zone *zone;
};
/*
* The state of a page buffer. If the page buffer is free no particular page is bound to it,
* otherwise the page buffer is bound to particular page whose absolute pbn is in the pbn field. If
* the page is resident or dirty the page data is stable and may be accessed. Otherwise the page is
* in flight (incoming or outgoing) and its data should not be accessed.
*
* @note Update the static data in get_page_state_name() if you change this enumeration.
*/
enum vdo_page_buffer_state {
/* this page buffer is not being used */
PS_FREE,
/* this page is being read from store */
PS_INCOMING,
/* attempt to load this page failed */
PS_FAILED,
/* this page is valid and un-modified */
PS_RESIDENT,
/* this page is valid and modified */
PS_DIRTY,
/* this page is being written and should not be used */
PS_OUTGOING,
/* not a state */
PAGE_STATE_COUNT,
} __packed;
/*
* The write status of page
*/
enum vdo_page_write_status {
WRITE_STATUS_NORMAL,
WRITE_STATUS_DISCARD,
WRITE_STATUS_DEFERRED,
} __packed;
/* Per-page-slot information. */
struct page_info {
/* Preallocated page struct vio */
struct vio *vio;
/* back-link for references */
struct vdo_page_cache *cache;
/* the pbn of the page */
Annotation
- Immediate include surface: `linux/list.h`, `numeric.h`, `admin-state.h`, `completion.h`, `encodings.h`, `int-map.h`, `statistics.h`, `types.h`.
- Detected declarations: `struct vdo_page_cache`, `struct page_info`, `struct vdo_page_completion`, `struct forest`, `struct tree_page`, `struct dirty_lists`, `struct block_map_zone`, `struct block_map`, `enum vdo_page_buffer_state`, `enum vdo_page_write_status`.
- 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.