drivers/md/dm-vdo/indexer/index-layout.c
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/indexer/index-layout.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/indexer/index-layout.c- Extension
.c- Size
- 50068 bytes
- Lines
- 1765
- 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
index-layout.hlinux/random.hlogger.hmemory-alloc.hmurmurhash3.hnumeric.htime-utils.hconfig.hopen-chapter.hvolume-index.h
Detected Declarations
struct region_headerstruct layout_regionstruct region_tablestruct index_save_datastruct index_state_versionstruct index_state_data301struct index_save_layoutstruct sub_index_layoutstruct super_block_datastruct index_layoutstruct save_layout_sizesstruct sub_index_nonce_datastruct save_nonce_dataenum region_kindenum region_typefunction is_converted_super_blockfunction compute_sizesfunction uds_compute_index_sizefunction create_unique_nonce_datafunction hash_stufffunction generate_primary_noncefunction generate_secondary_noncefunction open_layout_readerfunction open_region_readerfunction open_layout_writerfunction open_region_writerfunction generate_super_block_datafunction define_sub_index_noncefunction setup_sub_indexfunction initialize_layoutfunction make_index_save_region_tablefunction encode_region_tablefunction write_index_save_headerfunction write_index_save_layoutfunction reset_index_save_layoutfunction invalidate_old_savefunction discard_index_state_datafunction make_layout_region_tablefunction write_layout_headerfunction write_uds_index_configfunction save_layoutfunction create_index_layoutfunction generate_index_save_noncefunction validate_index_save_layoutfunction find_latest_uds_index_save_slotfunction uds_discard_open_chapterfunction uds_load_index_statefunction instantiate_index_save_layout
Annotated Snippet
struct region_header {
u64 magic;
u64 region_blocks;
u16 type;
/* Currently always version 1 */
u16 version;
u16 region_count;
u16 payload;
};
struct layout_region {
u64 start_block;
u64 block_count;
u32 __unused;
u16 kind;
u16 instance;
};
struct region_table {
size_t encoded_size;
struct region_header header;
struct layout_region regions[];
};
struct index_save_data {
u64 timestamp;
u64 nonce;
/* Currently always version 1 */
u32 version;
u32 unused__;
};
struct index_state_version {
s32 signature;
s32 version_id;
};
static const struct index_state_version INDEX_STATE_VERSION_301 = {
.signature = -1,
.version_id = 301,
};
struct index_state_data301 {
struct index_state_version version;
u64 newest_chapter;
u64 oldest_chapter;
u64 last_save;
u32 unused;
u32 padding;
};
struct index_save_layout {
unsigned int zone_count;
struct layout_region index_save;
struct layout_region header;
struct layout_region index_page_map;
struct layout_region free_space;
struct layout_region volume_index_zones[MAX_ZONES];
struct layout_region open_chapter;
struct index_save_data save_data;
struct index_state_data301 state_data;
};
struct sub_index_layout {
u64 nonce;
struct layout_region sub_index;
struct layout_region volume;
struct index_save_layout *saves;
};
struct super_block_data {
u8 magic_label[MAGIC_SIZE];
u8 nonce_info[NONCE_INFO_SIZE];
u64 nonce;
u32 version;
u32 block_size;
u16 index_count;
u16 max_saves;
/* Padding reflects a blank field on permanent storage */
u8 padding[4];
u64 open_chapter_blocks;
u64 page_map_blocks;
u64 volume_offset;
u64 start_offset;
};
struct index_layout {
struct io_factory *factory;
size_t factory_size;
off_t offset;
Annotation
- Immediate include surface: `index-layout.h`, `linux/random.h`, `logger.h`, `memory-alloc.h`, `murmurhash3.h`, `numeric.h`, `time-utils.h`, `config.h`.
- Detected declarations: `struct region_header`, `struct layout_region`, `struct region_table`, `struct index_save_data`, `struct index_state_version`, `struct index_state_data301`, `struct index_save_layout`, `struct sub_index_layout`, `struct super_block_data`, `struct index_layout`.
- 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.