drivers/md/dm-vdo/indexer/volume.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/indexer/volume.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/indexer/volume.h- Extension
.h- Size
- 5456 bytes
- Lines
- 173
- 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/atomic.hlinux/cache.hlinux/dm-bufio.hlinux/limits.hpermassert.hthread-utils.hchapter-index.hconfig.hgeometry.hindexer.hindex-layout.hindex-page-map.hradix-sort.hsparse-cache.h
Detected Declarations
struct queued_readstruct cached_pagestruct page_cachestruct volumeenum index_lookup_mode
Annotated Snippet
struct queued_read {
bool invalid;
bool reserved;
u32 physical_page;
struct uds_request *first_request;
struct uds_request *last_request;
};
struct __aligned(L1_CACHE_BYTES) search_pending_counter {
u64 atomic_value;
};
struct cached_page {
/* Whether this page is currently being read asynchronously */
bool read_pending;
/* The physical page stored in this cache entry */
u32 physical_page;
/* The value of the volume clock when this page was last used */
s64 last_used;
/* The cached page buffer */
struct dm_buffer *buffer;
/* The chapter index page, meaningless for record pages */
struct delta_index_page index_page;
};
struct page_cache {
/* The number of zones */
unsigned int zone_count;
/* The number of volume pages that can be cached */
u32 indexable_pages;
/* The maximum number of simultaneously cached pages */
u16 cache_slots;
/* An index for each physical page noting where it is in the cache */
u16 *index;
/* The array of cached pages */
struct cached_page *cache;
/* A counter for each zone tracking if a search is occurring there */
struct search_pending_counter *search_pending_counters;
/* The read queue entries as a circular array */
struct queued_read *read_queue;
/* All entries above this point are constant after initialization. */
/*
* These values are all indexes into the array of read queue entries. New entries in the
* read queue are enqueued at read_queue_last. To dequeue entries, a reader thread gets the
* lock and then claims the entry pointed to by read_queue_next_read and increments that
* value. After the read is completed, the reader thread calls release_read_queue_entry(),
* which increments read_queue_first until it points to a pending read, or is equal to
* read_queue_next_read. This means that if multiple reads are outstanding,
* read_queue_first might not advance until the last of the reads finishes.
*/
u16 read_queue_first;
u16 read_queue_next_read;
u16 read_queue_last;
atomic64_t clock;
};
struct volume {
struct index_geometry *geometry;
struct dm_bufio_client *client;
u64 nonce;
size_t cache_size;
/* A single page worth of records, for sorting */
const struct uds_volume_record **record_pointers;
/* Sorter for sorting records within each page */
struct radix_sorter *radix_sorter;
struct sparse_cache *sparse_cache;
struct page_cache page_cache;
struct index_page_map *index_page_map;
struct mutex read_threads_mutex;
struct cond_var read_threads_cond;
struct cond_var read_threads_read_done_cond;
struct thread **reader_threads;
unsigned int read_thread_count;
bool read_threads_exiting;
enum index_lookup_mode lookup_mode;
unsigned int reserved_buffers;
};
int __must_check uds_make_volume(const struct uds_configuration *config,
struct index_layout *layout,
struct volume **new_volume);
void uds_free_volume(struct volume *volume);
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/cache.h`, `linux/dm-bufio.h`, `linux/limits.h`, `permassert.h`, `thread-utils.h`, `chapter-index.h`, `config.h`.
- Detected declarations: `struct queued_read`, `struct cached_page`, `struct page_cache`, `struct volume`, `enum index_lookup_mode`.
- 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.