drivers/md/dm-vdo/data-vio.c
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/data-vio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/data-vio.c- Extension
.c- Size
- 67333 bytes
- Lines
- 2056
- 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
data-vio.hlinux/atomic.hlinux/bio.hlinux/blkdev.hlinux/delay.hlinux/device-mapper.hlinux/jiffies.hlinux/kernel.hlinux/list.hlinux/lz4.hlinux/minmax.hlinux/sched.hlinux/spinlock.hlinux/string.hlinux/wait.hlogger.hmemory-alloc.hmurmurhash3.hpermassert.hblock-map.hdump.hencodings.hint-map.hio-submitter.hlogical-zone.hpacker.hrecovery-journal.hslab-depot.hstatus-codes.htypes.hvdo.hvio.h
Detected Declarations
struct limiterstruct limiterstruct data_vio_poolenum data_vio_cleanup_stagefunction as_data_vio_poolfunction get_arrival_timefunction check_for_drain_complete_lockedfunction initialize_lbn_lockfunction launch_locked_requestfunction acknowledge_data_viofunction copy_to_biofunction bio_for_each_segmentfunction get_data_vio_compression_statusfunction pack_statusfunction set_data_vio_compression_statusfunction advance_data_vio_compression_stagefunction cancel_data_vio_compressionfunction attempt_logical_block_lockfunction requestfunction launch_data_viofunction copy_from_biofunction bio_for_each_segmentfunction launch_biofunction assign_data_viofunction assign_discard_permitfunction get_waitersfunction assign_data_vio_to_waiterfunction update_limiterfunction schedule_releasesfunction reuse_or_release_resourcesfunction process_release_callbackfunction initialize_limiterfunction initialize_data_viofunction destroy_data_viofunction make_data_vio_poolfunction free_data_vio_poolfunction list_for_each_entry_safefunction acquire_permitfunction wait_permitfunction vdo_launch_biofunction initiate_drainfunction assert_on_vdo_cpu_threadfunction drain_data_vio_poolfunction resume_data_vio_poolfunction dump_limiterfunction dump_data_vio_poolfunction get_data_vio_pool_active_requestsfunction get_data_vio_pool_request_limit
Annotated Snippet
struct limiter {
/* The data_vio_pool to which this limiter belongs */
struct data_vio_pool *pool;
/* The maximum number of data_vios available */
data_vio_count_t limit;
/* The number of resources in use */
data_vio_count_t busy;
/* The maximum number of resources ever simultaneously in use */
data_vio_count_t max_busy;
/* The number of resources to release */
data_vio_count_t release_count;
/* The number of waiters to wake */
data_vio_count_t wake_count;
/* The list of waiting bios which are known to process_release_callback() */
struct bio_list waiters;
/* The list of waiting bios which are not yet known to process_release_callback() */
struct bio_list new_waiters;
/* The list of waiters which have their permits */
struct bio_list *permitted_waiters;
/* The function for assigning a resource to a waiter */
assigner_fn assigner;
/* The queue of blocked threads */
wait_queue_head_t blocked_threads;
/* The arrival time of the eldest waiter */
u64 arrival;
};
/*
* A data_vio_pool is a collection of preallocated data_vios which may be acquired from any thread,
* and are released in batches.
*/
struct data_vio_pool {
/* Completion for scheduling releases */
struct vdo_completion completion;
/* The administrative state of the pool */
struct admin_state state;
/* Lock protecting the pool */
spinlock_t lock;
/* The main limiter controlling the total data_vios in the pool. */
struct limiter limiter;
/* The limiter controlling data_vios for discard */
struct limiter discard_limiter;
/* The list of bios which have discard permits but still need a data_vio */
struct bio_list permitted_discards;
/* The list of available data_vios */
struct list_head available;
/* The queue of data_vios waiting to be returned to the pool */
struct funnel_queue *queue;
/* Whether the pool is processing, or scheduled to process releases */
atomic_t processing;
/* The data vios in the pool */
struct data_vio data_vios[];
};
static const char * const ASYNC_OPERATION_NAMES[] = {
"launch",
"acknowledge_write",
"acquire_hash_lock",
"attempt_logical_block_lock",
"lock_duplicate_pbn",
"check_for_duplication",
"cleanup",
"compress_data_vio",
"find_block_map_slot",
"get_mapped_block_for_read",
"get_mapped_block_for_write",
"hash_data_vio",
"journal_remapping",
"vdo_attempt_packing",
"put_mapped_block",
"read_data_vio",
"update_dedupe_index",
"update_reference_counts",
"verify_duplication",
"write_data_vio",
};
/* The steps taken cleaning up a VIO, in the order they are performed. */
enum data_vio_cleanup_stage {
VIO_CLEANUP_START,
VIO_RELEASE_HASH_LOCK = VIO_CLEANUP_START,
VIO_RELEASE_ALLOCATED,
VIO_RELEASE_RECOVERY_LOCKS,
VIO_RELEASE_LOGICAL,
VIO_CLEANUP_DONE
};
static inline struct data_vio_pool * __must_check
as_data_vio_pool(struct vdo_completion *completion)
{
Annotation
- Immediate include surface: `data-vio.h`, `linux/atomic.h`, `linux/bio.h`, `linux/blkdev.h`, `linux/delay.h`, `linux/device-mapper.h`, `linux/jiffies.h`, `linux/kernel.h`.
- Detected declarations: `struct limiter`, `struct limiter`, `struct data_vio_pool`, `enum data_vio_cleanup_stage`, `function as_data_vio_pool`, `function get_arrival_time`, `function check_for_drain_complete_locked`, `function initialize_lbn_lock`, `function launch_locked_request`, `function acknowledge_data_vio`.
- 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.