drivers/md/dm-vdo/slab-depot.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/slab-depot.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/slab-depot.h- Extension
.h- Size
- 22212 bytes
- Lines
- 613
- 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/dm-kcopyd.hlinux/list.hnumeric.hadmin-state.hcompletion.hdata-vio.hencodings.hphysical-zone.hpriority-table.hrecovery-journal.hstatistics.htypes.hvio.hwait-queue.h
Detected Declarations
struct vdo_slabstruct journal_lockstruct slab_journalstruct reference_blockstruct search_cursorstruct vdo_slabstruct slab_scrubberstruct slab_actorstruct slab_iteratorstruct slab_statusstruct slab_summary_blockstruct atomic_slab_summary_statisticsstruct block_allocatorstruct slab_depotstruct reference_updaterenum reference_statusenum slab_rebuild_statusenum block_allocator_drain_stepenum slab_depot_load_type
Annotated Snippet
struct journal_lock {
u16 count;
sequence_number_t recovery_start;
};
struct slab_journal {
/* A waiter object for getting a VIO pool entry */
struct vdo_waiter resource_waiter;
/* A waiter object for updating the slab summary */
struct vdo_waiter slab_summary_waiter;
/* A waiter object for getting a vio with which to flush */
struct vdo_waiter flush_waiter;
/* The queue of VIOs waiting to make an entry */
struct vdo_wait_queue entry_waiters;
/* The parent slab reference of this journal */
struct vdo_slab *slab;
/* Whether a tail block commit is pending */
bool waiting_to_commit;
/* Whether the journal is updating the slab summary */
bool updating_slab_summary;
/* Whether the journal is adding entries from the entry_waiters queue */
bool adding_entries;
/* Whether a partial write is in progress */
bool partial_write_in_progress;
/* The oldest block in the journal on disk */
sequence_number_t head;
/* The oldest block in the journal which may not be reaped */
sequence_number_t unreapable;
/* The end of the half-open interval of the active journal */
sequence_number_t tail;
/* The next journal block to be committed */
sequence_number_t next_commit;
/* The tail sequence number that is written in the slab summary */
sequence_number_t summarized;
/* The tail sequence number that was last summarized in slab summary */
sequence_number_t last_summarized;
/* The sequence number of the recovery journal lock */
sequence_number_t recovery_lock;
/*
* The number of entries which fit in a single block. Can't use the constant because unit
* tests change this number.
*/
journal_entry_count_t entries_per_block;
/*
* The number of full entries which fit in a single block. Can't use the constant because
* unit tests change this number.
*/
journal_entry_count_t full_entries_per_block;
/* The recovery journal of the VDO (slab journal holds locks on it) */
struct recovery_journal *recovery_journal;
/* The statistics shared by all slab journals in our physical zone */
struct slab_journal_statistics *events;
/* A list of the VIO pool entries for outstanding journal block writes */
struct list_head uncommitted_blocks;
/*
* The current tail block header state. This will be packed into the block just before it
* is written.
*/
struct slab_journal_block_header tail_header;
/* A pointer to a block-sized buffer holding the packed block data */
struct packed_slab_journal_block *block;
/* The number of blocks in the on-disk journal */
block_count_t size;
/* The number of blocks at which to start pushing reference blocks */
block_count_t flushing_threshold;
/* The number of blocks at which all reference blocks should be writing */
block_count_t flushing_deadline;
/* The number of blocks at which to wait for reference blocks to write */
block_count_t blocking_threshold;
/* The number of blocks at which to scrub the slab before coming online */
block_count_t scrubbing_threshold;
/* This list entry is for block_allocator to keep a queue of dirty journals */
struct list_head dirty_entry;
/* The lock for the oldest unreaped block of the journal */
struct journal_lock *reap_lock;
/* The locks for each on disk block */
struct journal_lock *locks;
};
/*
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/dm-kcopyd.h`, `linux/list.h`, `numeric.h`, `admin-state.h`, `completion.h`, `data-vio.h`, `encodings.h`.
- Detected declarations: `struct vdo_slab`, `struct journal_lock`, `struct slab_journal`, `struct reference_block`, `struct search_cursor`, `struct vdo_slab`, `struct slab_scrubber`, `struct slab_actor`, `struct slab_iterator`, `struct slab_status`.
- 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.