[PATCH] md: Allow stripes to be expanded in preparation for expanding an array
[powerpc.git] / include / linux / raid / raid5.h
index f025ba6..b7b2653 100644 (file)
  */
 
 struct stripe_head {
-       struct stripe_head      *hash_next, **hash_pprev; /* hash pointers */
+       struct hlist_node       hash;
        struct list_head        lru;                    /* inactive_list or handle_list */
        struct raid5_private_data       *raid_conf;
        sector_t                sector;                 /* sector of this row */
@@ -152,7 +152,6 @@ struct stripe_head {
 #define        R5_Insync       3       /* rdev && rdev->in_sync at start */
 #define        R5_Wantread     4       /* want to schedule a read */
 #define        R5_Wantwrite    5
-#define        R5_Syncio       6       /* this io need to be accounted as resync io */
 #define        R5_Overlap      7       /* There is a pending overlapping request on this block */
 #define        R5_ReadError    8       /* seen a read error here recently */
 #define        R5_ReWrite      9       /* have tried to over-write the readerror */
@@ -205,7 +204,7 @@ struct disk_info {
 };
 
 struct raid5_private_data {
-       struct stripe_head      **stripe_hashtbl;
+       struct hlist_head       *stripe_hashtbl;
        mddev_t                 *mddev;
        struct disk_info        *spare;
        int                     chunk_size, level, algorithm;
@@ -217,7 +216,11 @@ struct raid5_private_data {
        struct list_head        bitmap_list; /* stripes delaying awaiting bitmap update */
        atomic_t                preread_active_stripes; /* stripes with scheduled io */
 
-       char                    cache_name[20];
+       /* unfortunately we need two cache names as we temporarily have
+        * two caches.
+        */
+       int                     active_name;
+       char                    cache_name[2][20];
        kmem_cache_t            *slab_cache; /* for allocating stripes */
 
        int                     seq_flush, seq_write;
@@ -228,6 +231,8 @@ struct raid5_private_data {
                                            * Cleared when a sync completes.
                                            */
 
+       struct page             *spare_page; /* Used when checking P/Q in raid6 */
+
        /*
         * Free stripes pool
         */
@@ -237,9 +242,10 @@ struct raid5_private_data {
        wait_queue_head_t       wait_for_overlap;
        int                     inactive_blocked;       /* release of inactive stripes blocked,
                                                         * waiting for 25% to be free
-                                                        */        
+                                                        */
+       int                     pool_size; /* number of disks in stripeheads in pool */
        spinlock_t              device_lock;
-       struct disk_info        disks[0];
+       struct disk_info        *disks;
 };
 
 typedef struct raid5_private_data raid5_conf_t;