summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>1999-08-10 18:18:30 +0000
committeroster <oster@NetBSD.org>1999-08-10 18:18:30 +0000
commita3aefdaee388521572d9227d00bec608b25b7db9 (patch)
tree51b7ce225334eed4fb2d5c37617c7a92a6dece5e /sys/dev/raidframe
parentce3252697de6c92987a080a22b8c2d8e19d889cc (diff)
Add support for easily checking the parity status from userland.
Also: spl protect rf_RewriteParity().
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c8
-rw-r--r--sys/dev/raidframe/rf_raidframe.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index e69a4601e2d..ebf6aea0ae7 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.21 1999/07/21 03:15:26 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.22 1999/08/10 18:18:30 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -988,7 +988,9 @@ raidioctl(dev, cmd, data, flag, p)
/* borrow the thread of the requesting process */
raidPtrs[unit]->proc = p; /* Blah... :-p GO */
+ s = splbio();
retcode = rf_RewriteParity(raidPtrs[unit]);
+ splx(s);
/* return I/O Error if the parity rewrite fails */
if (retcode) {
@@ -1083,7 +1085,9 @@ raidioctl(dev, cmd, data, flag, p)
return (retcode);
}
break;
-
+ case RAIDFRAME_CHECK_PARITY:
+ *(int *) data = raidPtrs[unit]->parity_good;
+ return (0);
case RAIDFRAME_RESET_ACCTOTALS:
{
RF_Raid_t *raid = raidPtrs[unit];
diff --git a/sys/dev/raidframe/rf_raidframe.h b/sys/dev/raidframe/rf_raidframe.h
index 8cc0b13fbd3..aad567f0791 100644
--- a/sys/dev/raidframe/rf_raidframe.h
+++ b/sys/dev/raidframe/rf_raidframe.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raidframe.h,v 1.5 1999/03/02 03:18:48 oster Exp $ */
+/* $NetBSD: rf_raidframe.h,v 1.6 1999/08/10 18:18:30 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -139,5 +139,5 @@ typedef struct RF_DeviceConfig_s {
#define RAIDFRAME_ADD_HOT_SPARE _IOW ('r', 22, RF_SingleComponent_t)
#define RAIDFRAME_REMOVE_HOT_SPARE _IOW ('r', 23, RF_SingleComponent_t)
#define RAIDFRAME_REBUILD_IN_PLACE _IOW ('r', 24, RF_SingleComponent_t)
-
+#define RAIDFRAME_CHECK_PARITY _IOWR ('r', 25, int)
#endif /* !_RF__RF_RAIDFRAME_H_ */