Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe Do a better job of (re)initializing the co...
details: https://anonhg.NetBSD.org/src/rev/fd79230a46b3
branches: trunk
changeset: 482838:fd79230a46b3
user: oster <oster%NetBSD.org@localhost>
date: Wed Feb 23 02:03:03 2000 +0000
description:
Do a better job of (re)initializing the component labels after
a reconstruct or a copyback.
diffstat:
sys/dev/raidframe/rf_copyback.c | 31 ++++++++++++++++++-------------
sys/dev/raidframe/rf_reconstruct.c | 13 ++++---------
2 files changed, 22 insertions(+), 22 deletions(-)
diffs (85 lines):
diff -r d98d32ed67ed -r fd79230a46b3 sys/dev/raidframe/rf_copyback.c
--- a/sys/dev/raidframe/rf_copyback.c Wed Feb 23 02:01:55 2000 +0000
+++ b/sys/dev/raidframe/rf_copyback.c Wed Feb 23 02:03:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_copyback.c,v 1.12 2000/01/09 01:29:28 oster Exp $ */
+/* $NetBSD: rf_copyback.c,v 1.13 2000/02/23 02:03:03 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -126,11 +126,21 @@
if (raidPtr->raid_cinfo[frow][fcol].ci_vp != NULL) {
printf("Closed the open device: %s\n",
raidPtr->Disks[frow][fcol].devname);
- VOP_UNLOCK(raidPtr->raid_cinfo[frow][fcol].ci_vp, 0);
- (void) vn_close(raidPtr->raid_cinfo[frow][fcol].ci_vp,
- FREAD | FWRITE, proc->p_ucred, proc);
+ if (raidPtr->Disks[frow][fcol].auto_configured == 1) {
+ VOP_CLOSE(raidPtr->raid_cinfo[frow][fcol].ci_vp,
+ FREAD, NOCRED, 0);
+ vput(raidPtr->raid_cinfo[frow][fcol].ci_vp);
+ } else {
+ VOP_UNLOCK(raidPtr->raid_cinfo[frow][fcol].ci_vp, 0);
+ (void) vn_close(raidPtr->raid_cinfo[frow][fcol].ci_vp,
+ FREAD | FWRITE, proc->p_ucred, proc);
+ }
raidPtr->raid_cinfo[frow][fcol].ci_vp = NULL;
+
}
+ /* note that this disk was *not* auto_configured (any longer) */
+ raidPtr->Disks[frow][fcol].auto_configured = 0;
+
printf("About to (re-)open the device: %s\n",
raidPtr->Disks[frow][fcol].devname);
@@ -231,17 +241,12 @@
raidread_component_label( raidPtr->raid_cinfo[frow][fcol].ci_dev,
raidPtr->raid_cinfo[frow][fcol].ci_vp,
&c_label);
-
- c_label.version = RF_COMPONENT_LABEL_VERSION;
- c_label.mod_counter = raidPtr->mod_counter;
- c_label.serial_number = raidPtr->serial_number;
+
+ raid_init_component_label( raidPtr, &c_label );
+
c_label.row = frow;
c_label.column = fcol;
- c_label.num_rows = raidPtr->numRow;
- c_label.num_columns = raidPtr->numCol;
- c_label.clean = RF_RAID_DIRTY;
- c_label.status = rf_ds_optimal;
-
+
raidwrite_component_label( raidPtr->raid_cinfo[frow][fcol].ci_dev,
raidPtr->raid_cinfo[frow][fcol].ci_vp,
&c_label);
diff -r d98d32ed67ed -r fd79230a46b3 sys/dev/raidframe/rf_reconstruct.c
--- a/sys/dev/raidframe/rf_reconstruct.c Wed Feb 23 02:01:55 2000 +0000
+++ b/sys/dev/raidframe/rf_reconstruct.c Wed Feb 23 02:03:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_reconstruct.c,v 1.15 2000/02/13 04:53:57 oster Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.16 2000/02/23 02:03:03 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -583,16 +583,11 @@
raidread_component_label(raidPtr->raid_cinfo[row][col].ci_dev,
raidPtr->raid_cinfo[row][col].ci_vp,
&c_label);
-
- c_label.version = RF_COMPONENT_LABEL_VERSION;
- c_label.mod_counter = raidPtr->mod_counter;
- c_label.serial_number = raidPtr->serial_number;
+
+ raid_init_component_label(raidPtr, &c_label);
+
c_label.row = row;
c_label.column = col;
- c_label.num_rows = raidPtr->numRow;
- c_label.num_columns = raidPtr->numCol;
- c_label.clean = RF_RAID_DIRTY;
- c_label.status = rf_ds_optimal;
raidwrite_component_label(raidPtr->raid_cinfo[row][col].ci_dev,
raidPtr->raid_cinfo[row][col].ci_vp,
Home |
Main Index |
Thread Index |
Old Index