drivers/md/dm-vdo/encodings.c
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/encodings.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/encodings.c- Extension
.c- Size
- 53380 bytes
- Lines
- 1690
- 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
encodings.hlinux/log2.hlogger.hmemory-alloc.hpermassert.hconstants.hindexer.hstatus-codes.htypes.h
Detected Declarations
struct geometry_blockfunction validate_versionfunction vdo_validate_headerfunction encode_version_numberfunction vdo_encode_headerfunction decode_version_numberfunction vdo_decode_headerfunction decode_volume_geometryfunction vdo_encode_volume_geometryfunction vdo_parse_geometry_blockfunction vdo_validate_block_map_pagefunction decode_block_map_state_2_0function encode_block_map_state_2_0function vdo_compute_new_forest_pagesfunction encode_recovery_journal_state_7_0function decode_recovery_journal_state_7_0function vdo_get_journal_operation_namefunction encode_slab_depot_state_2_0function decode_slab_depot_state_2_0function vdo_configure_slab_depotfunction vdo_configure_slabfunction vdo_decode_slab_journal_entryfunction allocate_partitionfunction make_partitionfunction vdo_initialize_layoutfunction vdo_uninitialize_layoutfunction vdo_get_partitionfunction vdo_get_known_partitionfunction encode_layoutfunction decode_layoutfunction pack_vdo_configfunction pack_vdo_componentfunction encode_vdo_componentfunction unpack_vdo_configfunction unpack_vdo_component_41_0function decode_vdo_componentfunction vdo_validate_configfunction vdo_destroy_component_statesfunction decode_componentsfunction vdo_decode_component_statesfunction vdo_validate_component_statesfunction vdo_encode_component_statesfunction vdo_encode_super_blockfunction vdo_decode_super_blockfunction vdo_initialize_component_statesfunction vdo_compute_index_blocksfunction vdo_initialize_volume_geometry
Annotated Snippet
struct geometry_block {
char magic_number[VDO_GEOMETRY_MAGIC_NUMBER_SIZE];
struct packed_header header;
u32 checksum;
} __packed;
static const struct header GEOMETRY_BLOCK_HEADER_5_0 = {
.id = VDO_GEOMETRY_BLOCK,
.version = {
.major_version = 5,
.minor_version = 0,
},
/*
* Note: this size isn't just the payload size following the header, like it is everywhere
* else in VDO.
*/
.size = sizeof(struct geometry_block) + sizeof(struct volume_geometry),
};
static const struct header GEOMETRY_BLOCK_HEADER_4_0 = {
.id = VDO_GEOMETRY_BLOCK,
.version = {
.major_version = 4,
.minor_version = 0,
},
/*
* Note: this size isn't just the payload size following the header, like it is everywhere
* else in VDO.
*/
.size = sizeof(struct geometry_block) + sizeof(struct volume_geometry_4_0),
};
const u8 VDO_GEOMETRY_MAGIC_NUMBER[VDO_GEOMETRY_MAGIC_NUMBER_SIZE + 1] = "dmvdo001";
#define PAGE_HEADER_4_1_SIZE (8 + 8 + 8 + 1 + 1 + 1 + 1)
static const struct version_number BLOCK_MAP_4_1 = {
.major_version = 4,
.minor_version = 1,
};
const struct header VDO_BLOCK_MAP_HEADER_2_0 = {
.id = VDO_BLOCK_MAP,
.version = {
.major_version = 2,
.minor_version = 0,
},
.size = sizeof(struct block_map_state_2_0),
};
const struct header VDO_RECOVERY_JOURNAL_HEADER_7_0 = {
.id = VDO_RECOVERY_JOURNAL,
.version = {
.major_version = 7,
.minor_version = 0,
},
.size = sizeof(struct recovery_journal_state_7_0),
};
const struct header VDO_SLAB_DEPOT_HEADER_2_0 = {
.id = VDO_SLAB_DEPOT,
.version = {
.major_version = 2,
.minor_version = 0,
},
.size = sizeof(struct slab_depot_state_2_0),
};
static const struct header VDO_LAYOUT_HEADER_3_0 = {
.id = VDO_LAYOUT,
.version = {
.major_version = 3,
.minor_version = 0,
},
.size = sizeof(struct layout_3_0) + (sizeof(struct partition_3_0) * VDO_PARTITION_COUNT),
};
static const enum partition_id REQUIRED_PARTITIONS[] = {
VDO_BLOCK_MAP_PARTITION,
VDO_SLAB_DEPOT_PARTITION,
VDO_RECOVERY_JOURNAL_PARTITION,
VDO_SLAB_SUMMARY_PARTITION,
};
/*
* The current version for the data encoded in the super block. This must be changed any time there
* is a change to encoding of the component data of any VDO component.
*/
static const struct version_number VDO_COMPONENT_DATA_41_0 = {
.major_version = 41,
Annotation
- Immediate include surface: `encodings.h`, `linux/log2.h`, `logger.h`, `memory-alloc.h`, `permassert.h`, `constants.h`, `indexer.h`, `status-codes.h`.
- Detected declarations: `struct geometry_block`, `function validate_version`, `function vdo_validate_header`, `function encode_version_number`, `function vdo_encode_header`, `function decode_version_number`, `function vdo_decode_header`, `function decode_volume_geometry`, `function vdo_encode_volume_geometry`, `function vdo_parse_geometry_block`.
- 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.