]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/raid5.h
raid5: handle io error of batch list
[karo-tx-linux.git] / drivers / md / raid5.h
index 983e18a83db138e4f99079e45159df39285d3b80..cf3562e99440c33b72f6f781575a4b7c7adc7b11 100644 (file)
@@ -210,11 +210,19 @@ struct stripe_head {
        atomic_t                count;        /* nr of active thread/requests */
        int                     bm_seq; /* sequence number for bitmap flushes */
        int                     disks;          /* disks in stripe */
+       int                     overwrite_disks; /* total overwrite disks in stripe,
+                                                 * this is only checked when stripe
+                                                 * has STRIPE_BATCH_READY
+                                                 */
        enum check_states       check_state;
        enum reconstruct_states reconstruct_state;
        spinlock_t              stripe_lock;
        int                     cpu;
        struct r5worker_group   *group;
+
+       struct stripe_head      *batch_head; /* protected by stripe lock */
+       spinlock_t              batch_lock; /* only header's lock is useful */
+       struct list_head        batch_list; /* protected by head's batch lock*/
        /**
         * struct stripe_operations
         * @target - STRIPE_OP_COMPUTE_BLK target
@@ -327,6 +335,8 @@ enum {
        STRIPE_ON_UNPLUG_LIST,
        STRIPE_DISCARD,
        STRIPE_ON_RELEASE_LIST,
+       STRIPE_BATCH_READY,
+       STRIPE_BATCH_ERR,
 };
 
 /*
@@ -458,15 +468,11 @@ struct r5conf {
        /* per cpu variables */
        struct raid5_percpu {
                struct page     *spare_page; /* Used when checking P/Q in raid6 */
-               void            *scribble;   /* space for constructing buffer
+               struct flex_array *scribble;   /* space for constructing buffer
                                              * lists and performing address
                                              * conversions
                                              */
        } __percpu *percpu;
-       size_t                  scribble_len; /* size of scribble region must be
-                                              * associated with conf to handle
-                                              * cpu hotplug while reshaping
-                                              */
 #ifdef CONFIG_HOTPLUG_CPU
        struct notifier_block   cpu_notify;
 #endif