Add support for easily checking the parity status from userland.

Also: spl protect rf_RewriteParity().
This commit is contained in:
oster 1999-08-10 18:18:30 +00:00
parent ce3252697d
commit a3aefdaee3
2 changed files with 8 additions and 4 deletions

View File

@ -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. * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
@ -988,7 +988,9 @@ raidioctl(dev, cmd, data, flag, p)
/* borrow the thread of the requesting process */ /* borrow the thread of the requesting process */
raidPtrs[unit]->proc = p; /* Blah... :-p GO */ raidPtrs[unit]->proc = p; /* Blah... :-p GO */
s = splbio();
retcode = rf_RewriteParity(raidPtrs[unit]); retcode = rf_RewriteParity(raidPtrs[unit]);
splx(s);
/* return I/O Error if the parity rewrite fails */ /* return I/O Error if the parity rewrite fails */
if (retcode) { if (retcode) {
@ -1083,7 +1085,9 @@ raidioctl(dev, cmd, data, flag, p)
return (retcode); return (retcode);
} }
break; break;
case RAIDFRAME_CHECK_PARITY:
*(int *) data = raidPtrs[unit]->parity_good;
return (0);
case RAIDFRAME_RESET_ACCTOTALS: case RAIDFRAME_RESET_ACCTOTALS:
{ {
RF_Raid_t *raid = raidPtrs[unit]; RF_Raid_t *raid = raidPtrs[unit];

View File

@ -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. * Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved. * 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_ADD_HOT_SPARE _IOW ('r', 22, RF_SingleComponent_t)
#define RAIDFRAME_REMOVE_HOT_SPARE _IOW ('r', 23, 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_REBUILD_IN_PLACE _IOW ('r', 24, RF_SingleComponent_t)
#define RAIDFRAME_CHECK_PARITY _IOWR ('r', 25, int)
#endif /* !_RF__RF_RAIDFRAME_H_ */ #endif /* !_RF__RF_RAIDFRAME_H_ */