summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2000-03-07 02:28:05 +0000
committeroster <oster@NetBSD.org>2000-03-07 02:28:05 +0000
commitddebc1cad0c13f5287f6953dc2da498c7f966899 (patch)
treebe6f41a31c947b469dec5ecae1fb0c7bb43c1ea1 /sys/dev/raidframe
parent33a55d022b5262f887d74ae32f4a426f48c70ca5 (diff)
Move rf_UnconfigureVnodes to rf_netbsdkintf.c where it will be more at home.
Add prototype to rf_kintf.h, and nuke old prototypes from rf_disks.c and rf_driver.c .
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_disks.c3
-rw-r--r--sys/dev/raidframe/rf_driver.c60
-rw-r--r--sys/dev/raidframe/rf_kintf.h3
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c59
4 files changed, 62 insertions, 63 deletions
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index b3255bf2b9a..ec06653f1ba 100644
--- a/sys/dev/raidframe/rf_disks.c
+++ b/sys/dev/raidframe/rf_disks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.22 2000/03/03 03:47:17 oster Exp $ */
+/* $NetBSD: rf_disks.c,v 1.23 2000/03/07 02:28:05 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -85,7 +85,6 @@
#include <sys/vnode.h>
/* XXX these should be in a header file somewhere */
-void rf_UnconfigureVnodes( RF_Raid_t * );
int rf_CheckLabels( RF_Raid_t *, RF_Config_t *);
static int rf_AllocDiskStructures(RF_Raid_t *, RF_Config_t *);
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c
index 3018faeec5e..43133fa98ca 100644
--- a/sys/dev/raidframe/rf_driver.c
+++ b/sys/dev/raidframe/rf_driver.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_driver.c,v 1.33 2000/02/29 16:54:29 oster Exp $ */
+/* $NetBSD: rf_driver.c,v 1.34 2000/03/07 02:28:05 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -136,7 +136,6 @@ static int init_rad(RF_RaidAccessDesc_t *);
static void clean_rad(RF_RaidAccessDesc_t *);
static void rf_ShutdownRDFreeList(void *);
static int rf_ConfigureRDFreeList(RF_ShutdownList_t **);
-void rf_UnconfigureVnodes( RF_Raid_t * );
RF_DECLARE_MUTEX(rf_printf_mutex) /* debug only: avoids interleaved
* printfs by different stripes */
@@ -281,63 +280,6 @@ rf_Shutdown(raidPtr)
return (0);
}
-void
-rf_UnconfigureVnodes( raidPtr )
- RF_Raid_t *raidPtr;
-{
- int r,c;
- struct proc *p;
-
-
- /* We take this opportunity to close the vnodes like we should.. */
-
- p = raidPtr->engine_thread;
-
- for (r = 0; r < raidPtr->numRow; r++) {
- for (c = 0; c < raidPtr->numCol; c++) {
- printf("Closing vnode for row: %d col: %d\n", r, c);
- if (raidPtr->raid_cinfo[r][c].ci_vp != NULL) {
- if (raidPtr->Disks[r][c].auto_configured == 1) {
- VOP_CLOSE(raidPtr->raid_cinfo[r][c].ci_vp,
- FREAD, NOCRED, 0);
- vput(raidPtr->raid_cinfo[r][c].ci_vp);
-
- } else {
- VOP_UNLOCK(raidPtr->raid_cinfo[r][c].ci_vp, 0);
- (void) vn_close(raidPtr->raid_cinfo[r][c].ci_vp,
- FREAD | FWRITE, p->p_ucred, p);
- }
- raidPtr->raid_cinfo[r][c].ci_vp = NULL;
- raidPtr->Disks[r][c].auto_configured = 0;
- } else {
- printf("vnode was NULL\n");
- }
-
- }
- }
- for (r = 0; r < raidPtr->numSpare; r++) {
- printf("Closing vnode for spare: %d\n", r);
- if (raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp) {
- if (raidPtr->Disks[0][raidPtr->numCol + r].auto_configured == 1) {
- VOP_CLOSE(raidPtr->raid_cinfo[0][raidPtr->numCol +r].ci_vp,
- FREAD, NOCRED, 0);
- vput(raidPtr->raid_cinfo[0][raidPtr->numCol +r].ci_vp);
-
- } else {
- VOP_UNLOCK(raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp, 0);
- (void) vn_close(raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp,
- FREAD | FWRITE, p->p_ucred, p);
- }
- raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp = NULL;
- raidPtr->Disks[0][raidPtr->numCol + r].auto_configured = 0;
- } else {
- printf("vnode was NULL\n");
- }
- }
-
-
-}
-
#define DO_INIT_CONFIGURE(f) { \
rc = f (&globalShutdown); \
diff --git a/sys/dev/raidframe/rf_kintf.h b/sys/dev/raidframe/rf_kintf.h
index ceeb27f4198..09f7ed6d717 100644
--- a/sys/dev/raidframe/rf_kintf.h
+++ b/sys/dev/raidframe/rf_kintf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_kintf.h,v 1.10 2000/03/07 02:12:14 oster Exp $ */
+/* $NetBSD: rf_kintf.h,v 1.11 2000/03/07 02:28:05 oster Exp $ */
/*
* rf_kintf.h
*
@@ -50,5 +50,6 @@ int raidmarkclean(dev_t dev, struct vnode *b_vp, int);
int raidmarkdirty(dev_t dev, struct vnode *b_vp, int);
void raid_init_component_label __P((RF_Raid_t *, RF_ComponentLabel_t *));
void rf_print_component_label __P((RF_ComponentLabel_t *));
+void rf_UnconfigureVnodes( RF_Raid_t * );
#endif /* _RF__RF_KINTF_H_ */
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 109546e5207..9b2fd58c9fd 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.67 2000/03/07 02:12:13 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.68 2000/03/07 02:28:05 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -2432,6 +2432,63 @@ rf_final_update_component_labels( raidPtr )
/* printf("Component labels updated\n"); */
}
+void
+rf_UnconfigureVnodes( raidPtr )
+ RF_Raid_t *raidPtr;
+{
+ int r,c;
+ struct proc *p;
+
+
+ /* We take this opportunity to close the vnodes like we should.. */
+
+ p = raidPtr->engine_thread;
+
+ for (r = 0; r < raidPtr->numRow; r++) {
+ for (c = 0; c < raidPtr->numCol; c++) {
+ printf("Closing vnode for row: %d col: %d\n", r, c);
+ if (raidPtr->raid_cinfo[r][c].ci_vp != NULL) {
+ if (raidPtr->Disks[r][c].auto_configured == 1) {
+ VOP_CLOSE(raidPtr->raid_cinfo[r][c].ci_vp,
+ FREAD, NOCRED, 0);
+ vput(raidPtr->raid_cinfo[r][c].ci_vp);
+
+ } else {
+ VOP_UNLOCK(raidPtr->raid_cinfo[r][c].ci_vp, 0);
+ (void) vn_close(raidPtr->raid_cinfo[r][c].ci_vp,
+ FREAD | FWRITE, p->p_ucred, p);
+ }
+ raidPtr->raid_cinfo[r][c].ci_vp = NULL;
+ raidPtr->Disks[r][c].auto_configured = 0;
+ } else {
+ printf("vnode was NULL\n");
+ }
+
+ }
+ }
+ for (r = 0; r < raidPtr->numSpare; r++) {
+ printf("Closing vnode for spare: %d\n", r);
+ if (raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp) {
+ if (raidPtr->Disks[0][raidPtr->numCol + r].auto_configured == 1) {
+ VOP_CLOSE(raidPtr->raid_cinfo[0][raidPtr->numCol +r].ci_vp,
+ FREAD, NOCRED, 0);
+ vput(raidPtr->raid_cinfo[0][raidPtr->numCol +r].ci_vp);
+
+ } else {
+ VOP_UNLOCK(raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp, 0);
+ (void) vn_close(raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp,
+ FREAD | FWRITE, p->p_ucred, p);
+ }
+ raidPtr->raid_cinfo[0][raidPtr->numCol + r].ci_vp = NULL;
+ raidPtr->Disks[0][raidPtr->numCol + r].auto_configured = 0;
+ } else {
+ printf("vnode was NULL\n");
+ }
+ }
+
+
+}
+
void
rf_ReconThread(req)