Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe Add bits for eventual support of deleteing...
details: https://anonhg.NetBSD.org/src/rev/cfffa632a3b2
branches: trunk
changeset: 484149:cfffa632a3b2
user: oster <oster%NetBSD.org@localhost>
date: Sun Mar 26 22:38:28 2000 +0000
description:
Add bits for eventual support of deleteing components and moving
hot-spares into the main set.
diffstat:
sys/dev/raidframe/rf_disks.c | 34 +++++++++++++++++++++++++++++++++-
sys/dev/raidframe/rf_netbsd.h | 6 ++++--
sys/dev/raidframe/rf_netbsdkintf.c | 18 +++++++++++++++++-
sys/dev/raidframe/rf_raidframe.h | 4 +++-
4 files changed, 57 insertions(+), 5 deletions(-)
diffs (120 lines):
diff -r c20389d6857b -r cfffa632a3b2 sys/dev/raidframe/rf_disks.c
--- a/sys/dev/raidframe/rf_disks.c Sun Mar 26 21:55:55 2000 +0000
+++ b/sys/dev/raidframe/rf_disks.c Sun Mar 26 22:38:28 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.24 2000/03/25 16:24:57 oster Exp $ */
+/* $NetBSD: rf_disks.c,v 1.25 2000/03/26 22:38:29 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -1090,3 +1090,35 @@
}
+int
+rf_delete_component(raidPtr,component)
+ RF_Raid_t *raidPtr;
+ RF_SingleComponent_t *component;
+{
+ RF_RaidDisk_t *disks;
+
+ if ((component->row < 0) ||
+ (component->row >= raidPtr->numRow) ||
+ (component->column < 0) ||
+ (component->column >= raidPtr->numCol)) {
+ return(EINVAL);
+ }
+
+ disks = &raidPtr->Disks[component->row][component->column];
+
+ /* 1. This component must be marked as 'failed' */
+
+ return(EINVAL); /* Not implemented yet. */
+}
+
+int
+rf_incorporate_hot_spare(raidPtr,component)
+ RF_Raid_t *raidPtr;
+ RF_SingleComponent_t *component;
+{
+
+ /* Issues here include how to 'move' this in if there is IO
+ taking place (e.g. component queues and such) */
+
+ return(EINVAL); /* Not implemented yet. */
+}
diff -r c20389d6857b -r cfffa632a3b2 sys/dev/raidframe/rf_netbsd.h
--- a/sys/dev/raidframe/rf_netbsd.h Sun Mar 26 21:55:55 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsd.h Sun Mar 26 22:38:28 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsd.h,v 1.9 2000/02/23 00:37:11 oster Exp $ */
+/* $NetBSD: rf_netbsd.h,v 1.10 2000/03/26 22:38:29 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -108,7 +108,9 @@
/* XXX this is *not* the place for these... */
int rf_add_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *sparePtr);
int rf_remove_hot_spare(RF_Raid_t *raidPtr, RF_SingleComponent_t *sparePtr);
-
+int rf_delete_component(RF_Raid_t *raidPtr, RF_SingleComponent_t *component);
+int rf_incorporate_hot_spare(RF_Raid_t *raidPtr,
+ RF_SingleComponent_t *component);
struct raidcinfo {
struct vnode *ci_vp; /* component device's vnode */
diff -r c20389d6857b -r cfffa632a3b2 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Sun Mar 26 21:55:55 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Sun Mar 26 22:38:28 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.72 2000/03/22 01:41:41 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.73 2000/03/26 22:38:28 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -828,6 +828,8 @@
case RAIDFRAME_CHECK_COPYBACK_STATUS:
case RAIDFRAME_SET_AUTOCONFIG:
case RAIDFRAME_SET_ROOT:
+ case RAIDFRAME_DELETE_COMPONENT:
+ case RAIDFRAME_INCORPORATE_HOT_SPARE:
if ((rs->sc_flags & RAIDF_INITED) == 0)
return (ENXIO);
}
@@ -1104,6 +1106,20 @@
case RAIDFRAME_REMOVE_HOT_SPARE:
return(retcode);
+ case RAIDFRAME_DELETE_COMPONENT:
+ componentPtr = (RF_SingleComponent_t *)data;
+ memcpy( &component, componentPtr,
+ sizeof(RF_SingleComponent_t));
+ retcode = rf_delete_component(raidPtr, &component);
+ return(retcode);
+
+ case RAIDFRAME_INCORPORATE_HOT_SPARE:
+ componentPtr = (RF_SingleComponent_t *)data;
+ memcpy( &component, componentPtr,
+ sizeof(RF_SingleComponent_t));
+ retcode = rf_incorporate_hot_spare(raidPtr, &component);
+ return(retcode);
+
case RAIDFRAME_REBUILD_IN_PLACE:
if (raidPtr->Layout.map->faultsTolerated == 0) {
diff -r c20389d6857b -r cfffa632a3b2 sys/dev/raidframe/rf_raidframe.h
--- a/sys/dev/raidframe/rf_raidframe.h Sun Mar 26 21:55:55 2000 +0000
+++ b/sys/dev/raidframe/rf_raidframe.h Sun Mar 26 22:38:28 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raidframe.h,v 1.9 2000/02/13 04:53:58 oster Exp $ */
+/* $NetBSD: rf_raidframe.h,v 1.10 2000/03/26 22:38:29 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -132,4 +132,6 @@
#define RAIDFRAME_CHECK_COPYBACK_STATUS _IOWR ('r', 27, int)
#define RAIDFRAME_SET_AUTOCONFIG _IOWR ('r', 28, int)
#define RAIDFRAME_SET_ROOT _IOWR ('r', 29, int)
+#define RAIDFRAME_DELETE_COMPONENT _IOW ('r', 30, RF_SingleComponent_t)
+#define RAIDFRAME_INCORPORATE_HOT_SPARE _IOW ('r', 31, RF_SingleComponent_t)
#endif /* !_RF__RF_RAIDFRAME_H_ */
Home |
Main Index |
Thread Index |
Old Index