drivers/md/dm-vdo/recovery-journal.h
Source file repositories/reference/linux-study-clean/drivers/md/dm-vdo/recovery-journal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/md/dm-vdo/recovery-journal.h- Extension
.h- Size
- 14333 bytes
- Lines
- 317
- 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/list.hnumeric.hadmin-state.hconstants.hencodings.hflush.hstatistics.htypes.hwait-queue.h
Detected Declarations
struct lock_counterstruct recovery_journal_blockstruct recovery_journalenum vdo_zone_typefunction vdo_get_recovery_journal_block_numberfunction vdo_compute_recovery_journal_check_byte
Annotated Snippet
struct lock_counter {
/* The completion for notifying the owner of a lock release */
struct vdo_completion completion;
/* The number of logical zones which may hold locks */
zone_count_t logical_zones;
/* The number of physical zones which may hold locks */
zone_count_t physical_zones;
/* The number of locks */
block_count_t locks;
/* Whether the lock release notification is in flight */
atomic_t state;
/* The number of logical zones which hold each lock */
atomic_t *logical_zone_counts;
/* The number of physical zones which hold each lock */
atomic_t *physical_zone_counts;
/* The per-lock counts for the journal zone */
u16 *journal_counters;
/* The per-lock decrement counts for the journal zone */
atomic_t *journal_decrement_counts;
/* The per-zone, per-lock reference counts for logical zones */
u16 *logical_counters;
/* The per-zone, per-lock reference counts for physical zones */
u16 *physical_counters;
};
struct recovery_journal_block {
/* The doubly linked pointers for the free or active lists */
struct list_head list_node;
/* The waiter for the pending full block list */
struct vdo_waiter write_waiter;
/* The journal to which this block belongs */
struct recovery_journal *journal;
/* A pointer to the current sector in the packed block buffer */
struct packed_journal_sector *sector;
/* The vio for writing this block */
struct vio vio;
/* The sequence number for this block */
sequence_number_t sequence_number;
/* The location of this block in the on-disk journal */
physical_block_number_t block_number;
/* Whether this block is being committed */
bool committing;
/* The total number of entries in this block */
journal_entry_count_t entry_count;
/* The total number of uncommitted entries (queued or committing) */
journal_entry_count_t uncommitted_entry_count;
/* The number of new entries in the current commit */
journal_entry_count_t entries_in_commit;
/* The queue of vios which will make entries for the next commit */
struct vdo_wait_queue entry_waiters;
/* The queue of vios waiting for the current commit */
struct vdo_wait_queue commit_waiters;
};
struct recovery_journal {
/* The thread ID of the journal zone */
thread_id_t thread_id;
/* The slab depot which can hold locks on this journal */
struct slab_depot *depot;
/* The block map which can hold locks on this journal */
struct block_map *block_map;
/* The queue of vios waiting to make entries */
struct vdo_wait_queue entry_waiters;
/* The number of free entries in the journal */
u64 available_space;
/* The number of decrement entries which need to be made */
data_vio_count_t pending_decrement_count;
/* Whether the journal is adding entries from the increment or decrement waiters queues */
bool adding_entries;
/* The administrative state of the journal */
struct admin_state state;
/* Whether a reap is in progress */
bool reaping;
/* The location of the first journal block */
physical_block_number_t origin;
/* The oldest active block in the journal on disk for block map rebuild */
sequence_number_t block_map_head;
/* The oldest active block in the journal on disk for slab journal replay */
sequence_number_t slab_journal_head;
/* The newest block in the journal on disk to which a write has finished */
sequence_number_t last_write_acknowledged;
/* The end of the half-open interval of the active journal */
sequence_number_t tail;
/* The point at which the last entry will have been added */
struct journal_point append_point;
/* The journal point of the vio most recently released from the journal */
struct journal_point commit_point;
/* The nonce of the VDO */
nonce_t nonce;
/* The number of recoveries completed by the VDO */
Annotation
- Immediate include surface: `linux/list.h`, `numeric.h`, `admin-state.h`, `constants.h`, `encodings.h`, `flush.h`, `statistics.h`, `types.h`.
- Detected declarations: `struct lock_counter`, `struct recovery_journal_block`, `struct recovery_journal`, `enum vdo_zone_type`, `function vdo_get_recovery_journal_block_number`, `function vdo_compute_recovery_journal_check_byte`.
- 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.