md: remove typedefs: r10bio_t -> struct r10bio and r1bio_t -> struct r1bio
[linux-2.6-block.git] / drivers / md / raid10.h
index 944b1104d3b447c4437e847ad9e268e5c3fb0715..be7f8d9cfc63f43e90827b38b2d5b1e2bbca224c 100644 (file)
@@ -4,14 +4,17 @@
 typedef struct mirror_info mirror_info_t;
 
 struct mirror_info {
-       mdk_rdev_t      *rdev;
+       struct md_rdev  *rdev;
        sector_t        head_position;
+       int             recovery_disabled;      /* matches
+                                                * mddev->recovery_disabled
+                                                * when we shouldn't try
+                                                * recovering this device.
+                                                */
 };
 
-typedef struct r10bio_s r10bio_t;
-
 struct r10_private_data_s {
-       mddev_t                 *mddev;
+       struct mddev            *mddev;
        mirror_info_t           *mirrors;
        int                     raid_disks;
        spinlock_t              device_lock;
@@ -63,7 +66,7 @@ struct r10_private_data_s {
        /* When taking over an array from a different personality, we store
         * the new thread here until we fully activate the array.
         */
-       struct mdk_thread_s     *thread;
+       struct md_thread        *thread;
 };
 
 typedef struct r10_private_data_s conf_t;
@@ -75,14 +78,14 @@ typedef struct r10_private_data_s conf_t;
  * for this RAID10 operation, and about their status:
  */
 
-struct r10bio_s {
+struct r10bio {
        atomic_t                remaining; /* 'have we finished' count,
                                            * used from IRQ handlers
                                            */
        sector_t                sector; /* virtual sector number */
        int                     sectors;
        unsigned long           state;
-       mddev_t                 *mddev;
+       struct mddev            *mddev;
        /*
         * original bio going to /dev/mdx
         */
@@ -113,10 +116,26 @@ struct r10bio_s {
  * level, we store IO_BLOCKED in the appropriate 'bios' pointer
  */
 #define IO_BLOCKED ((struct bio*)1)
+/* When we successfully write to a known bad-block, we need to remove the
+ * bad-block marking which must be done from process context.  So we record
+ * the success by setting devs[n].bio to IO_MADE_GOOD
+ */
+#define IO_MADE_GOOD ((struct bio *)2)
+
+#define BIO_SPECIAL(bio) ((unsigned long)bio <= 2)
 
 /* bits for r10bio.state */
 #define        R10BIO_Uptodate 0
 #define        R10BIO_IsSync   1
 #define        R10BIO_IsRecover 2
 #define        R10BIO_Degraded 3
+/* Set ReadError on bios that experience a read error
+ * so that raid10d knows what to do with them.
+ */
+#define        R10BIO_ReadError 4
+/* If a write for this request means we can clear some
+ * known-bad-block records, we set this flag.
+ */
+#define        R10BIO_MadeGood 5
+#define        R10BIO_WriteError 6
 #endif