summaryrefslogtreecommitdiffstats
path: root/sys/geom/raid3/g_raid3.h
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-08-22 16:21:12 +0000
committerpjd <pjd@FreeBSD.org>2004-08-22 16:21:12 +0000
commit7e2ef21ad90efdeb778bd1faea580f1c1687ffe6 (patch)
treede1c132fb71dfe957365121a3a93c74acfc8a7f0 /sys/geom/raid3/g_raid3.h
parentbe94cde364f800cf85113f772c600382765a7361 (diff)
downloadFreeBSD-src-7e2ef21ad90efdeb778bd1faea580f1c1687ffe6.zip
FreeBSD-src-7e2ef21ad90efdeb778bd1faea580f1c1687ffe6.tar.gz
Implementation of 'verify reading' algorithm, which uses parity data for
verification of regular data when device is in complete state. On verification error, EIO error is returned for the bio and sysctl kern.geom.raid3.stat.parity_mismatch is increased. Suggested by: phk
Diffstat (limited to 'sys/geom/raid3/g_raid3.h')
-rw-r--r--sys/geom/raid3/g_raid3.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/geom/raid3/g_raid3.h b/sys/geom/raid3/g_raid3.h
index 2f40ddd..c936710 100644
--- a/sys/geom/raid3/g_raid3.h
+++ b/sys/geom/raid3/g_raid3.h
@@ -39,8 +39,9 @@
* Version history:
* 0 - Initial version number.
* 1 - Added 'round-robin reading' algorithm.
+ * 2 - Added 'verify reading' algorithm.
*/
-#define G_RAID3_VERSION 1
+#define G_RAID3_VERSION 2
#define G_RAID3_DISK_FLAG_DIRTY 0x0000000000000001ULL
#define G_RAID3_DISK_FLAG_SYNCHRONIZING 0x0000000000000002ULL
@@ -52,8 +53,10 @@
#define G_RAID3_DEVICE_FLAG_NOAUTOSYNC 0x0000000000000001ULL
#define G_RAID3_DEVICE_FLAG_ROUND_ROBIN 0x0000000000000002ULL
+#define G_RAID3_DEVICE_FLAG_VERIFY 0x0000000000000004ULL
#define G_RAID3_DEVICE_FLAG_MASK (G_RAID3_DEVICE_FLAG_NOAUTOSYNC | \
- G_RAID3_DEVICE_FLAG_ROUND_ROBIN)
+ G_RAID3_DEVICE_FLAG_ROUND_ROBIN | \
+ G_RAID3_DEVICE_FLAG_VERIFY)
#ifdef _KERNEL
extern u_int g_raid3_debug;
@@ -88,9 +91,18 @@ extern u_int g_raid3_debug;
#define G_RAID3_BIO_CFLAG_PARITY 0x04
#define G_RAID3_BIO_CFLAG_NODISK 0x08
#define G_RAID3_BIO_CFLAG_REGSYNC 0x10
+#define G_RAID3_BIO_CFLAG_MASK (G_RAID3_BIO_CFLAG_REGULAR | \
+ G_RAID3_BIO_CFLAG_SYNC | \
+ G_RAID3_BIO_CFLAG_PARITY | \
+ G_RAID3_BIO_CFLAG_NODISK | \
+ G_RAID3_BIO_CFLAG_REGSYNC)
#define G_RAID3_BIO_PFLAG_DEGRADED 0x01
#define G_RAID3_BIO_PFLAG_NOPARITY 0x02
+#define G_RAID3_BIO_PFLAG_VERIFY 0x04
+#define G_RAID3_BIO_PFLAG_MASK (G_RAID3_BIO_PFLAG_DEGRADED | \
+ G_RAID3_BIO_PFLAG_NOPARITY | \
+ G_RAID3_BIO_PFLAG_VERIFY)
/*
* Informations needed for synchronization.
@@ -291,6 +303,8 @@ raid3_metadata_dump(const struct g_raid3_metadata *md)
printf(" NOAUTOSYNC");
if ((md->md_mflags & G_RAID3_DEVICE_FLAG_ROUND_ROBIN) != 0)
printf(" ROUND-ROBIN");
+ if ((md->md_mflags & G_RAID3_DEVICE_FLAG_VERIFY) != 0)
+ printf(" VERIFY");
}
printf("\n");
printf(" dflags:");
OpenPOWER on IntegriCloud