]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/raid/raid5.h
md: replace STRIPE_OP_CHECK with 'check_states'
[linux-2.6-omap-h63xx.git] / include / linux / raid / raid5.h
index 1301195abf4b6a7f261b42818b5dc9a3424a9709..2c96d5fd54bff4e441374f596b0f564c730d6d3d 100644 (file)
  *    the compute block completes.
  */
 
+/*
+ * Operations state - intermediate states that are visible outside of sh->lock
+ * In general _idle indicates nothing is running, _run indicates a data
+ * processing operation is active, and _result means the data processing result
+ * is stable and can be acted upon.  For simple operations like biofill and
+ * compute that only have an _idle and _run state they are indicated with
+ * sh->state flags (STRIPE_BIOFILL_RUN and STRIPE_COMPUTE_RUN)
+ */
+/**
+ * enum check_states - handles syncing / repairing a stripe
+ * @check_state_idle - check operations are quiesced
+ * @check_state_run - check operation is running
+ * @check_state_result - set outside lock when check result is valid
+ * @check_state_compute_run - check failed and we are repairing
+ * @check_state_compute_result - set outside lock when compute result is valid
+ */
+enum check_states {
+       check_state_idle = 0,
+       check_state_run, /* parity check */
+       check_state_check_result,
+       check_state_compute_run, /* parity repair */
+       check_state_compute_result,
+};
+
+/**
+ * enum reconstruct_states - handles writing or expanding a stripe
+ */
+enum reconstruct_states {
+       reconstruct_state_idle = 0,
+       reconstruct_state_drain_run,            /* write */
+       reconstruct_state_run,                  /* expand */
+       reconstruct_state_drain_result,
+       reconstruct_state_result,
+};
+
 struct stripe_head {
        struct hlist_node       hash;
        struct list_head        lru;                    /* inactive_list or handle_list */
@@ -169,6 +204,7 @@ struct stripe_head {
        spinlock_t              lock;
        int                     bm_seq; /* sequence number for bitmap flushes */
        int                     disks;                  /* disks in stripe */
+       enum check_states       check_state;
        /* stripe_operations
         * @pending - pending ops flags (set for request->issue->complete)
         * @ack - submitted ops flags (set for issue->complete)
@@ -202,6 +238,7 @@ struct stripe_head_state {
        int locked, uptodate, to_read, to_write, failed, written;
        int to_fill, compute, req_compute, non_overwrite;
        int failed_num;
+       unsigned long ops_request;
 };
 
 /* r6_state - extra state data only relevant to r6 */
@@ -254,8 +291,10 @@ struct r6_state {
 #define        STRIPE_EXPAND_READY     11
 #define        STRIPE_IO_STARTED       12 /* do not count towards 'bypass_count' */
 #define        STRIPE_FULL_WRITE       13 /* all blocks are set to be overwritten */
+#define        STRIPE_BIOFILL_RUN      14
+#define        STRIPE_COMPUTE_RUN      15
 /*
- * Operations flags (in issue order)
+ * Operation request flags
  */
 #define STRIPE_OP_BIOFILL      0
 #define STRIPE_OP_COMPUTE_BLK  1
@@ -264,11 +303,6 @@ struct r6_state {
 #define STRIPE_OP_POSTXOR      4
 #define STRIPE_OP_CHECK        5
 
-/* modifiers to the base operations
- * STRIPE_OP_MOD_REPAIR_PD - compute the parity block and write it back
- */
-#define STRIPE_OP_MOD_REPAIR_PD 7
-
 /*
  * Plugging:
  *