Lines Matching +full:lock +full:- +full:less
1 /* SPDX-License-Identifier: GPL-2.0-only */
13 #include "admin-state.h"
19 #include "wait-queue.h"
30 * The concurrency guarantees of this single-threaded model allow the code to omit more
31 * fine-grained locking for recovery journal structures.
33 * The journal consists of a set of on-disk blocks arranged as a circular log with monotonically
36 * half-open interval containing the active blocks. 'active' is the number of the block actively
38 * = active + 1, and head may be any value in the interval [tail - size, active].
40 * The journal also contains a set of in-memory blocks which are used to buffer up entries until
41 * they can be committed. In general the number of in-memory blocks ('tail_buffer_count') will be
42 * less than the on-disk size. Each in-memory block is also a vdo_completion. Each in-memory block
43 * has a vio which is used to commit that block to disk. The vio's data is the on-disk
44 * representation of the journal block. In addition each in-memory block has a buffer which is used
45 * to accumulate entries while a partial commit of the block is in progress. In-memory blocks are
50 * When entries are added to the journal, they are added to the active in-memory block, as
52 * committed, the requesting VIO will be attached to the in-memory block to which the caller's
55 * progress, the attempt will be ignored and then automatically retried when the in-progress commit
68 * are still active. Finally, each in-memory block map page tracks the oldest journal block that
70 * in-memory block map page is updated, it checks if the journal block for the VIO is earlier than
72 * decrements the count on the later journal block, maintaining a lock on the oldest journal block
78 * If there is no in-memory space when a VIO attempts to add an entry, the VIO will be attached to
80 * no on-disk space when a VIO attempts to add an entry, the VIO will be attached to the
92 /* The completion for notifying the owner of a lock release */
100 /* Whether the lock release notification is in flight */
102 /* The number of logical zones which hold each lock */
104 /* The number of physical zones which hold each lock */
106 /* The per-lock counts for the journal zone */
108 /* The per-lock decrement counts for the journal zone */
110 /* The per-zone, per-lock reference counts for logical zones */
112 /* The per-zone, per-lock reference counts for physical zones */
129 /* The location of this block in the on-disk journal */
172 /* The end of the half-open interval of the active journal */
184 /* Unused in-memory journal blocks */
186 /* In-memory journal blocks with records */
200 /* The data-less vio, usable only for flushing */
202 /* The number of blocks in the on-disk journal */
204 /* The number of logical blocks that are in-use */
214 /* The locks for each on-disk block */
221 * vdo_get_recovery_journal_block_number() - Get the physical block number for a given sequence
234 * from the low-order bits of the sequence. in vdo_get_recovery_journal_block_number()
236 return vdo_compute_recovery_journal_block_number(journal->size, sequence); in vdo_get_recovery_journal_block_number()
240 * vdo_compute_recovery_journal_check_byte() - Compute the check byte for a given sequence number.
251 return (((sequence / journal->size) & 0x7F) | 0x80); in vdo_compute_recovery_journal_check_byte()