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

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

File Facts

System
Linux kernel
Corpus path
drivers/md/dm-vdo/indexer/volume-index.h
Extension
.h
Size
6581 bytes
Lines
194
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 volume_index_stats {
	/* Nanoseconds spent rebalancing */
	ktime_t rebalance_time;
	/* Number of memory rebalances */
	u32 rebalance_count;
	/* 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_OVERFLOWs detected */
	u64 overflow_count;
	/* The number of delta lists */
	u32 delta_lists;
	/* Number of early flushes */
	u64 early_flushes;
};

struct volume_sub_index_zone {
	u64 virtual_chapter_low;
	u64 virtual_chapter_high;
	u64 early_flushes;
} __aligned(L1_CACHE_BYTES);

struct volume_sub_index {
	/* The delta index */
	struct delta_index delta_index;
	/* The first chapter to be flushed in each zone */
	u64 *flush_chapters;
	/* The zones */
	struct volume_sub_index_zone *zones;
	/* The volume nonce */
	u64 volume_nonce;
	/* Expected size of a chapter (per zone) */
	u64 chapter_zone_bits;
	/* Maximum size of the index (per zone) */
	u64 max_zone_bits;
	/* The number of bits in address mask */
	u8 address_bits;
	/* Mask to get address within delta list */
	u32 address_mask;
	/* The number of bits in chapter number */
	u8 chapter_bits;
	/* The largest storable chapter number */
	u32 chapter_mask;
	/* The number of chapters used */
	u32 chapter_count;
	/* The number of delta lists */
	u32 list_count;
	/* The number of zones */
	unsigned int zone_count;
	/* The amount of memory allocated */
	u64 memory_size;
};

struct volume_index_zone {
	/* Protects the sampled index in this zone */
	struct mutex hook_mutex;
} __aligned(L1_CACHE_BYTES);

struct volume_index {
	u32 sparse_sample_rate;
	unsigned int zone_count;
	u64 memory_size;
	struct volume_sub_index vi_non_hook;
	struct volume_sub_index vi_hook;
	struct volume_index_zone *zones;
};

/*
 * The volume_index_record structure is used to facilitate processing of a record name. A client
 * first calls uds_get_volume_index_record() to find the volume index record for a record name. The
 * fields of the record can then be examined to determine the state of the record.
 *
 * If is_found is false, then the index did not find an entry for the record name. Calling
 * uds_put_volume_index_record() will insert a new entry for that name at the proper place.
 *
 * If is_found is true, then we did find an entry for the record name, and the virtual_chapter and
 * is_collision fields reflect the entry found. Subsequently, a call to
 * uds_remove_volume_index_record() will remove the entry, a call to
 * uds_set_volume_index_record_chapter() will update the existing entry, and a call to
 * uds_put_volume_index_record() will insert a new collision record after the existing entry.
 */
struct volume_index_record {
	/* Public fields */

	/* Chapter where the record info is found */
	u64 virtual_chapter;
	/* This record is a collision */

Annotation

Implementation Notes