Lines Matching full:block

24  * The recovery_journal provides a log of all block mapping and reference count changes which have
25 * not yet been stably written to the block map or slab journals. This log helps to reduce the
26 * write amplification of writes by providing amortization of slab journal and block map page
35 * journal. The 'head' is the oldest active block in the journal. The 'tail' is the end of the
36 * half-open interval containing the active blocks. 'active' is the number of the block actively
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
46 * kept on two rings. Free blocks live on the 'free_tail_blocks' ring. When a block becomes active
47 * (see below) it is moved to the 'active_tail_blocks' ring. When a block is fully committed, it is
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
53 * entry was added. If the caller does wish to wait, or if the entry filled the active block, an
54 * attempt will be made to commit that block to disk. If there is already another commit in
56 * completes. If there is no commit in progress, any data_vios waiting on the block are transferred
57 * to the block's vio which is then written, automatically waking all of the waiters when it
58 * completes. When the write completes, any entries which accumulated in the block are copied to
61 * Finally, the journal maintains a set of counters, one for each on disk journal block. These
63 * sequence number is used, the counter for the corresponding block is incremented. The counter is
64 * subsequently decremented when that block is filled and then committed for the last time. This
66 * incremented once for each entry added to a block, and decremented once each time the block map
68 * are still active. Finally, each in-memory block map page tracks the oldest journal block that
69 * contains entries corresponding to uncommitted updates to that block map page. Each time an
70 * in-memory block map page is updated, it checks if the journal block for the VIO is earlier than
71 * the one it references, in which case it increments the count on the earlier journal block and
72 * decrements the count on the later journal block, maintaining a lock on the oldest journal block
73 * containing entries for that page. When a block map page has been flushed from the cache, the
74 * counter for the journal block it references is decremented. Whenever the counter for the head
75 * block goes to 0, the head is advanced until it comes to a block whose counter is not 0 or until
76 * it reaches the active block. This is the mechanism for reclaiming journal space on disk.
79 * the 'commit_completion' and will be woken the next time a full block has committed. If there is
81 * 'reap_completion', and will be woken the next time a journal block is reaped.
119 /* The waiter for the pending full block list */
121 /* The journal to which this block belongs */
123 /* A pointer to the current sector in the packed block buffer */
125 /* The vio for writing this block */
127 /* The sequence number for this block */
129 /* The location of this block in the on-disk journal */
131 /* Whether this block is being committed */
133 /* The total number of entries in this block */
150 /* The block map which can hold locks on this journal */
164 /* The location of the first journal block */
166 /* The oldest active block in the journal on disk for block map rebuild */
168 /* The oldest active block in the journal on disk for slab journal replay */
170 /* The newest block in the journal on disk to which a write has finished */
182 /* The number of entries which fit in a single block */
188 /* A pointer to the active block (the one we are adding entries to now) */
192 /* The new block map reap head after reaping */
194 /* The head block number for the block map rebuild range */
198 /* The head block number for the slab journal replay range */
206 /* The number of block map pages that are allocated */
214 /* The locks for each on-disk block */
221 * vdo_get_recovery_journal_block_number() - Get the physical block number for a given sequence
224 * @sequence: The sequence number of the desired block.
226 * Return: The block number corresponding to the sequence number.
233 * Since journal size is a power of two, the block number modulus can just be extracted in vdo_get_recovery_journal_block_number()