summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-07-31 10:03:52 +1000
committerNeilBrown <neilb@suse.de>2012-07-31 10:03:52 +1000
commit473e87ce485ffcac041f7911b33f0b4cd4d6cf2b (patch)
tree01ae284e058d1805055bf153dd9175f1782181e8 /drivers/md/raid10.c
parent0eaf822cb3dfcf2a64b2d27f4f6219186adb2695 (diff)
downloadlinux-stable-473e87ce485ffcac041f7911b33f0b4cd4d6cf2b.tar.gz
linux-stable-473e87ce485ffcac041f7911b33f0b4cd4d6cf2b.tar.bz2
linux-stable-473e87ce485ffcac041f7911b33f0b4cd4d6cf2b.zip
MD: Move macros from raid1*.h to raid1*.c
MD RAID1/RAID10: Move some macros from .h file to .c file There are three macros (IO_BLOCKED,IO_MADE_GOOD,BIO_SPECIAL) which are defined in both raid1.h and raid10.h. They are only used in there respective .c files. However, if we wish to make RAID10 accessible to the device-mapper RAID target (dm-raid.c), then we need to move these macros into the .c files where they are used so that they do not conflict with each other. The macros from the two files are identical and could be moved into md.h, but I chose to leave the duplication and have them remain in the personality files. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index f9c4baa7964d..e77acf024055 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -60,7 +60,21 @@
*/
#define NR_RAID10_BIOS 256
-/* When there are this many requests queue to be written by
+/* when we get a read error on a read-only array, we redirect to another
+ * device without failing the first device, or trying to over-write to
+ * correct the read error. To keep track of bad blocks on a per-bio
+ * 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)
+
+/* When there are this many requests queued to be written by
* the raid10 thread, we become 'congested' to provide back-pressure
* for writeback.
*/