raid5: refactor handle_stripe5 and handle_stripe6 (v3)
[linux-2.6-microblaze.git] / include / linux / raid / raid5.h
index 03636d7..b99d354 100644 (file)
@@ -145,6 +145,22 @@ struct stripe_head {
                unsigned long   flags;
        } dev[1]; /* allocated with extra space depending of RAID geometry */
 };
+
+/* stripe_head_state - collects and tracks the dynamic state of a stripe_head
+ *     for handle_stripe.  It is only valid under spin_lock(sh->lock);
+ */
+struct stripe_head_state {
+       int syncing, expanding, expanded;
+       int locked, uptodate, to_read, to_write, failed, written;
+       int non_overwrite;
+       int failed_num;
+};
+
+/* r6_state - extra state data only relevant to r6 */
+struct r6_state {
+       int p_failed, q_failed, qd_idx, failed_num[2];
+};
+
 /* Flags */
 #define        R5_UPTODATE     0       /* page contains current data */
 #define        R5_LOCKED       1       /* IO has been submitted on "req" */
@@ -227,7 +243,10 @@ struct raid5_private_data {
        struct list_head        handle_list; /* stripes needing handling */
        struct list_head        delayed_list; /* stripes that have plugged requests */
        struct list_head        bitmap_list; /* stripes delaying awaiting bitmap update */
+       struct bio              *retry_read_aligned; /* currently retrying aligned bios   */
+       struct bio              *retry_read_aligned_list; /* aligned bios retry list  */
        atomic_t                preread_active_stripes; /* stripes with scheduled io */
+       atomic_t                active_aligned_reads;
 
        atomic_t                reshape_stripes; /* stripes with pending writes for reshape */
        /* unfortunately we need two cache names as we temporarily have