• Home
  • Raw
  • Download

Lines Matching +full:use +full:- +full:parity

1 /* SPDX-License-Identifier: GPL-2.0 */
30 * Empty -> Want - on read or write to get old data for parity calc
31 * Empty -> Dirty - on compute_parity to satisfy write/sync request.
32 * Empty -> Clean - on compute_block when computing a block for failed drive
33 * Want -> Empty - on failed read
34 * Want -> Clean - on successful completion of read request
35 * Dirty -> Clean - on successful completion of write request
36 * Dirty -> Clean - on failed write
37 * Clean -> Dirty - on compute_parity to satisfy write/sync (RECONSTRUCT or RMW)
39 * The Want->Empty, Want->Clean, Dirty->Clean, transitions
42 * This leaves one multi-stage transition:
43 * Want->Dirty->Clean
51 * from parity calculations, and a clean block that has been
52 * successfully written to the spare ( or to parity when resyncing).
54 * is set whenever a write is scheduled to the spare, or to the parity
76 * third list, the written list (bh_written). Once both the parity
98 * - stripes have a reference counter. If count==0, they are on a list.
99 * - If a stripe might need handling, STRIPE_HANDLE is set.
100 * - When refcount reaches zero, then if STRIPE_HANDLE it is put on
104 * cleared while a stripe has a non-zero count means that if the
111 * lockdev check-hash unlink-stripe cnt++ clean-stripe hash-stripe unlockdev
113 * lockdev check-hash if(!cnt++)unlink-stripe unlockdev
115 * lockdev attach-buffer unlockdev
118 * (lockdev check-buffers unlockdev) ..
119 * change-state ..
122 …* lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlo…
130 * -copying data between the stripe cache and user application buffers
131 * -computing blocks to save a disk access, or to recover a missing block
132 * -updating the parity on a write operation (reconstruct write and
133 * read-modify-write)
134 * -checking parity correctness
135 * -running i/o to disk
140 * the count is non-zero.
143 * 1/ Parity check operations destroy the in cache version of the parity block,
144 * so we prevent parity dependent operations like writes and compute_blocks
146 * the check without damaging the parity block, in these cases the parity
147 * block is re-marked up to date (assuming the check was successful) and is
148 * not re-read from disk.
151 * to be held off, as well as parity checks and compute block operations.
159 * Operations state - intermediate states that are visible outside of
165 * sh->state flags (STRIPE_BIOFILL_RUN and STRIPE_COMPUTE_RUN)
168 * enum check_states - handles syncing / repairing a stripe
169 * @check_state_idle - check operations are quiesced
170 * @check_state_run - check operation is running
171 * @check_state_result - set outside lock when check result is valid
172 * @check_state_compute_run - check failed and we are repairing
173 * @check_state_compute_result - set outside lock when compute result is valid
177 check_state_run, /* xor parity check */
178 check_state_run_q, /* q-parity check */
179 check_state_run_pq, /* pq dual parity check */
181 check_state_compute_run, /* parity repair */
186 * enum reconstruct_states - handles writing or expanding a stripe
190 reconstruct_state_prexor_drain_run, /* prexor-write */
207 short pd_idx; /* parity disk index */
209 short ddf_layout;/* use DDF ordering to calculate Q */
236 struct list_head r5c; /* for r5c_cache->stripe_in_journal */
238 struct page *ppl_page; /* partial parity of this stripe */
241 * @target - STRIPE_OP_COMPUTE_BLK target
242 * @target2 - 2nd compute target in the raid6 case
243 * @zero_sum_result - P and Q verification flags
244 * @request - async service request flags for raid_run_ops
273 /* stripe_head_state - collects and tracks the dynamic state of a stripe_head
278 * to check/correct parity, or to reconstruct a missing device.
305 R5_Insync, /* rdev && rdev->in_sync at start */
310 R5_ReadNoMerge, /* prevent bio from merging in block-layer */
312 R5_ReWrite, /* have tried to over-write the readerror */
314 R5_Expanded, /* This block now has post-expand data */
318 R5_Wantfill, /* dev->toread contains a bio that needs
321 R5_Wantdrain, /* dev->towrite needs to be drained */
324 R5_WriteError, /* got a write error - need to record it */
330 * up-to-date at this stripe. */
337 * if R5_InJournal is set for parity pd_idx, all the
338 * data and parity being written are in the journal
342 * dev->orig_page for prexor. When this flag is
377 STRIPE_LOG_TRAPPED, /* trapped into log (see raid5-cache.c)
380 * 1. write-out phase
392 * see more detail in the raid5-cache.c
394 STRIPE_R5C_PARTIAL_STRIPE, /* in r5c cache (to-be/being handled or
395 * in conf->r5c_partial_stripe_list)
397 STRIPE_R5C_FULL_STRIPE, /* in r5c cache (to-be/being handled or
398 * in conf->r5c_full_stripe_list)
422 * RAID parity calculation preferences
444 * In particular, any write request that would require pre-reading
446 * in a pre-read phase. Further, if the "delayed" queue is empty when
457 * In stripe_handle, if we find pre-reading is necessary, we do it if
464 * 1/ when holding mddev->reconfig_mutex
465 * 2/ when resync/recovery/reshape is known to be happening - i.e. in code that
467 * 3/ while holding rcu_read_lock(), use rcu_dereference to get the pointer
468 * and if it is non-NULL, increment rdev->nr_pending before dropping the RCU
476 struct page *extra_page; /* extra page to use in prexor */
487 #define STRIPE_SHIFT (PAGE_SHIFT - 9)
494 #define HASH_MASK (NR_HASH - 1)
503 #define STRIPE_HASH_LOCKS_MASK (NR_STRIPE_HASH_LOCKS - 1)
521 * r5c journal modes of the array: write-back or write-through.
522 * write-through mode has identical behavior as existing log only
699 #define RAID5_STRIPE_SIZE(conf) ((conf)->stripe_size)
700 #define RAID5_STRIPE_SHIFT(conf) ((conf)->stripe_shift)
701 #define RAID5_STRIPE_SECTORS(conf) ((conf)->stripe_sectors)
716 return bio->bi_next; in r5_next_bio()
724 #define ALGORITHM_LEFT_ASYMMETRIC 0 /* Rotating Parity N with Data Restart */
725 #define ALGORITHM_RIGHT_ASYMMETRIC 1 /* Rotating Parity 0 with Data Restart */
726 #define ALGORITHM_LEFT_SYMMETRIC 2 /* Rotating Parity N with Data Continuation */
727 #define ALGORITHM_RIGHT_SYMMETRIC 3 /* Rotating Parity 0 with Data Continuation */
729 /* Define non-rotating (raid4) algorithms. These allow
736 * Firstly, the exact positioning of the parity block is slightly
743 * Interestingly DDFv1.2-Errata-A does not specify N_CONTINUE but
752 * with exactly the same layout for data and parity, and
753 * with the Q block always on the last device (N-1).
788 return (disk_idx % sh->stripes_per_page) * RAID5_STRIPE_SIZE(sh->raid_conf); in raid5_get_page_offset()
797 return sh->pages[disk_idx / sh->stripes_per_page]; in raid5_get_dev_page()