drivers/md/dm-vdo/data-vio.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/data-vio.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/data-vio.h- Extension
.h- Size
- 21835 bytes
- Lines
- 666
- 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/bio.hlinux/list.hpermassert.hindexer.hblock-map.hcompletion.hconstants.hdedupe.hencodings.hlogical-zone.hphysical-zone.htypes.hvdo.hvio.hwait-queue.h
Detected Declarations
struct lbn_lockstruct block_map_tree_slotstruct tree_lockstruct zoned_pbnstruct data_vio_compression_statusstruct compression_statestruct allocationstruct reference_updaterstruct data_viostruct data_vio_poolenum async_operation_numberenum data_vio_compression_stagefunction data_vio_has_flush_generation_lockfunction data_vio_has_allocationfunction continue_data_viofunction continue_data_vio_with_errorfunction assert_data_vio_in_hash_zonefunction set_data_vio_hash_zone_callbackfunction launch_data_vio_hash_zone_callbackfunction assert_data_vio_in_logical_zonefunction set_data_vio_logical_callbackfunction launch_data_vio_logical_callbackfunction assert_data_vio_in_allocated_zonefunction set_data_vio_allocated_zone_callbackfunction launch_data_vio_allocated_zone_callbackfunction assert_data_vio_in_duplicate_zonefunction set_data_vio_duplicate_zone_callbackfunction launch_data_vio_duplicate_zone_callbackfunction assert_data_vio_in_mapped_zonefunction set_data_vio_mapped_zone_callbackfunction assert_data_vio_in_new_mapped_zonefunction set_data_vio_new_mapped_zone_callbackfunction assert_data_vio_in_journal_zonefunction set_data_vio_journal_callbackfunction launch_data_vio_journal_callbackfunction assert_data_vio_in_packer_zonefunction set_data_vio_packer_callbackfunction launch_data_vio_packer_callbackfunction assert_data_vio_on_cpu_threadfunction set_data_vio_cpu_callbackfunction launch_data_vio_cpu_callbackfunction set_data_vio_bio_zone_callbackfunction launch_data_vio_bio_zone_callbackfunction launch_data_vio_on_bio_ack_queue
Annotated Snippet
struct lbn_lock {
logical_block_number_t lbn;
bool locked;
struct vdo_wait_queue waiters;
struct logical_zone *zone;
};
/* A position in the arboreal block map at a specific level. */
struct block_map_tree_slot {
page_number_t page_index;
struct block_map_slot block_map_slot;
};
/* Fields for using the arboreal block map. */
struct tree_lock {
/* The current height at which this data_vio is operating */
height_t height;
/* The block map tree for this LBN */
root_count_t root_index;
/* Whether we hold a page lock */
bool locked;
/* The key for the lock map */
u64 key;
/* The queue of waiters for the page this vio is allocating or loading */
struct vdo_wait_queue waiters;
/* The block map tree slots for this LBN */
struct block_map_tree_slot tree_slots[VDO_BLOCK_MAP_TREE_HEIGHT + 1];
};
struct zoned_pbn {
physical_block_number_t pbn;
enum block_mapping_state state;
struct physical_zone *zone;
};
/*
* Where a data_vio is on the compression path; advance_data_vio_compression_stage()
* depends on the order of this enum.
*/
enum data_vio_compression_stage {
/* A data_vio which has not yet entered the compression path */
DATA_VIO_PRE_COMPRESSOR,
/* A data_vio which is in the compressor */
DATA_VIO_COMPRESSING,
/* A data_vio which is blocked in the packer */
DATA_VIO_PACKING,
/* A data_vio which is no longer on the compression path (and never will be) */
DATA_VIO_POST_PACKER,
};
struct data_vio_compression_status {
enum data_vio_compression_stage stage;
bool may_not_compress;
};
struct compression_state {
/*
* The current compression status of this data_vio. This field contains a value which
* consists of a data_vio_compression_stage and a flag indicating whether a request has
* been made to cancel (or prevent) compression for this data_vio.
*
* This field should be accessed through the get_data_vio_compression_status() and
* set_data_vio_compression_status() methods. It should not be accessed directly.
*/
atomic_t status;
/* The compressed size of this block */
u16 size;
/* The packer input or output bin slot which holds the enclosing data_vio */
slot_number_t slot;
/* The packer bin to which the enclosing data_vio has been assigned */
struct packer_bin *bin;
/* A link in the chain of data_vios which have been packed together */
struct data_vio *next_in_batch;
/* A vio which is blocked in the packer while holding a lock this vio needs. */
struct data_vio *lock_holder;
/*
* The compressed block used to hold the compressed form of this block and that of any
* other blocks for which this data_vio is the compressed write agent.
*/
struct compressed_block *block;
};
/* Fields supporting allocation of data blocks. */
struct allocation {
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/bio.h`, `linux/list.h`, `permassert.h`, `indexer.h`, `block-map.h`, `completion.h`, `constants.h`.
- Detected declarations: `struct lbn_lock`, `struct block_map_tree_slot`, `struct tree_lock`, `struct zoned_pbn`, `struct data_vio_compression_status`, `struct compression_state`, `struct allocation`, `struct reference_updater`, `struct data_vio`, `struct data_vio_pool`.
- 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.