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.

Dependency Surface

Detected Declarations

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

Implementation Notes