drivers/md/dm-vdo/encodings.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/encodings.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/encodings.h- Extension
.h- Size
- 42795 bytes
- Lines
- 1291
- 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/blk_types.hlinux/crc32.hlinux/limits.hlinux/uuid.hnumeric.hconstants.htypes.h
Detected Declarations
struct version_numberstruct packed_version_numberstruct headerstruct packed_headerstruct index_configstruct volume_regionstruct volume_geometrystruct volume_geometry_4_0struct block_map_entrystruct block_map_page_headerstruct block_map_pagestruct block_map_state_2_0struct boundarystruct recovery_journal_state_7_0struct recovery_journal_entrystruct packed_recovery_journal_entrystruct packed_recovery_journal_entry_1struct recovery_block_headerstruct packed_journal_headerstruct packed_journal_sectorstruct journal_pointstruct packed_journal_pointstruct packed_reference_sectorstruct packed_reference_blockstruct slab_depot_state_2_0struct slab_journal_entrystruct slab_journal_block_headerstruct packed_slab_journal_block_headerstruct full_slab_journal_entriesstruct packed_slab_journal_blockstruct slab_summary_entrystruct layoutstruct partitionstruct layout_3_0struct partition_3_0struct vdo_configstruct vdo_componentstruct packed_vdo_configstruct packed_vdo_component_41_0struct vdo_component_statesenum volume_region_idenum block_map_page_validityenum journal_operation_1function vdo_are_same_versionfunction vdo_pack_version_numberfunction vdo_unpack_version_numberfunction vdo_pack_headerfunction vdo_unpack_header
Annotated Snippet
struct version_number {
u32 major_version;
u32 minor_version;
};
/*
* A packed, machine-independent, on-disk representation of a version_number. Both fields are
* stored in little-endian byte order.
*/
struct packed_version_number {
__le32 major_version;
__le32 minor_version;
} __packed;
/* The registry of component ids for use in headers */
#define VDO_SUPER_BLOCK 0
#define VDO_LAYOUT 1
#define VDO_RECOVERY_JOURNAL 2
#define VDO_SLAB_DEPOT 3
#define VDO_BLOCK_MAP 4
#define VDO_GEOMETRY_BLOCK 5
/* The header for versioned data stored on disk. */
struct header {
u32 id; /* The component this is a header for */
struct version_number version; /* The version of the data format */
size_t size; /* The size of the data following this header */
};
/* A packed, machine-independent, on-disk representation of a component header. */
struct packed_header {
__le32 id;
struct packed_version_number version;
__le64 size;
} __packed;
enum {
VDO_GEOMETRY_BLOCK_LOCATION = 0,
VDO_GEOMETRY_MAGIC_NUMBER_SIZE = 8,
VDO_DEFAULT_GEOMETRY_BLOCK_VERSION = 5,
};
struct index_config {
u32 mem;
u32 unused;
bool sparse;
} __packed;
enum volume_region_id {
VDO_INDEX_REGION = 0,
VDO_DATA_REGION = 1,
VDO_VOLUME_REGION_COUNT,
};
struct volume_region {
/* The ID of the region */
enum volume_region_id id;
/*
* The absolute starting offset on the device. The region continues until the next region
* begins.
*/
physical_block_number_t start_block;
} __packed;
struct volume_geometry {
/* For backwards compatibility */
u32 unused;
/* The nonce of this volume */
nonce_t nonce;
/* The uuid of this volume */
uuid_t uuid;
/* The block offset to be applied to bios */
block_count_t bio_offset;
/* The regions in ID order */
struct volume_region regions[VDO_VOLUME_REGION_COUNT];
/* The index config */
struct index_config index_config;
} __packed;
/* This volume geometry struct is used for sizing only */
struct volume_geometry_4_0 {
/* For backwards compatibility */
u32 unused;
/* The nonce of this volume */
nonce_t nonce;
/* The uuid of this volume */
uuid_t uuid;
/* The regions in ID order */
struct volume_region regions[VDO_VOLUME_REGION_COUNT];
/* The index config */
Annotation
- Immediate include surface: `linux/blk_types.h`, `linux/crc32.h`, `linux/limits.h`, `linux/uuid.h`, `numeric.h`, `constants.h`, `types.h`.
- Detected declarations: `struct version_number`, `struct packed_version_number`, `struct header`, `struct packed_header`, `struct index_config`, `struct volume_region`, `struct volume_geometry`, `struct volume_geometry_4_0`, `struct block_map_entry`, `struct block_map_page_header`.
- 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.