drivers/md/dm-vdo/indexer/delta-index.h

Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/indexer/delta-index.h

File Facts

System
Linux kernel
Corpus path
drivers/md/dm-vdo/indexer/delta-index.h
Extension
.h
Size
9681 bytes
Lines
280
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 delta_list {
	/* The offset of the delta list start, in bits */
	u64 start;
	/* The number of bits in the delta list */
	u16 size;
	/* Where the last search "found" the key, in bits */
	u16 save_offset;
	/* The key for the record just before save_offset */
	u32 save_key;
};

struct delta_zone {
	/* The delta list memory */
	u8 *memory;
	/* The delta list headers */
	struct delta_list *delta_lists;
	/* Temporary starts of delta lists */
	u64 *new_offsets;
	/* Buffered writer for saving an index */
	struct buffered_writer *buffered_writer;
	/* The size of delta list memory */
	size_t size;
	/* Nanoseconds spent rebalancing */
	ktime_t rebalance_time;
	/* Number of memory rebalances */
	u32 rebalance_count;
	/* The number of bits in a stored value */
	u8 value_bits;
	/* The number of bits in the minimal key code */
	u16 min_bits;
	/* The number of keys used in a minimal code */
	u32 min_keys;
	/* The number of keys used for another code bit */
	u32 incr_keys;
	/* The number of records in the index */
	u64 record_count;
	/* The number of collision records */
	u64 collision_count;
	/* The number of records removed */
	u64 discard_count;
	/* The number of UDS_OVERFLOW errors detected */
	u64 overflow_count;
	/* The index of the first delta list */
	u32 first_list;
	/* The number of delta lists */
	u32 list_count;
	/* Tag belonging to this delta index */
	u8 tag;
} __aligned(L1_CACHE_BYTES);

struct delta_list_save_info {
	/* Tag identifying which delta index this list is in */
	u8 tag;
	/* Bit offset of the start of the list data */
	u8 bit_offset;
	/* Number of bytes of list data */
	u16 byte_count;
	/* The delta list number within the delta index */
	u32 index;
} __packed;

struct delta_index {
	/* The zones */
	struct delta_zone *delta_zones;
	/* The number of zones */
	unsigned int zone_count;
	/* The number of delta lists */
	u32 list_count;
	/* Maximum lists per zone */
	u32 lists_per_zone;
	/* Total memory allocated to this index */
	size_t memory_size;
	/* The number of non-empty lists at load time per zone */
	u32 load_lists[MAX_ZONES];
	/* True if this index is mutable */
	bool mutable;
	/* Tag belonging to this delta index */
	u8 tag;
};

/*
 * A delta_index_page describes a single page of a chapter index. The delta_index field allows the
 * page to be treated as an immutable delta_index. We use the delta_zone field to treat the chapter
 * index page as a single zone index, and without the need to do an additional memory allocation.
 */
struct delta_index_page {
	struct delta_index delta_index;
	/* These values are loaded from the delta_page_header */
	u32 lowest_list_number;
	u32 highest_list_number;

Annotation

Implementation Notes