234 lines
5.1 KiB
Diff
234 lines
5.1 KiB
Diff
Index: 1.0.0.rc14/include/dmraid/lib_context.h
|
|
===================================================================
|
|
--- 1.0.0.rc14.orig/include/dmraid/lib_context.h 2005-09-21 13:46:53.000000000 +0200
|
|
+++ 1.0.0.rc14/include/dmraid/lib_context.h 2008-09-10 15:09:17.000000000 +0200
|
|
@@ -38,7 +38,12 @@
|
|
LC_VERBOSE,
|
|
LC_IGNORELOCKING,
|
|
LC_SEPARATOR,
|
|
- LC_DEVICES, /* Add new options below this one ! */
|
|
+ LC_DEVICES,
|
|
+ LC_PARTCHAR,
|
|
+ LC_CREATE,
|
|
+ LC_REBUILD_SET,
|
|
+ LC_REBUILD_DISK,
|
|
+ LC_HOT_SPARE_SET, /* Add new options below this one ! */
|
|
LC_OPTIONS_SIZE, /* Must be the last enumerator. */
|
|
};
|
|
|
|
@@ -62,6 +67,82 @@
|
|
#define OPT_STR_FORMAT(lc) OPT_STR(lc, LC_FORMAT)
|
|
#define OPT_STR_SEPARATOR(lc) OPT_STR(lc, LC_SEPARATOR)
|
|
|
|
+/* Options actions dmraid performs. */
|
|
+enum action {
|
|
+ UNDEF = 0x0,
|
|
+ ACTIVATE = 0x1,
|
|
+ DEACTIVATE = 0x2,
|
|
+ FORMAT = 0x4,
|
|
+#ifndef DMRAID_MINI
|
|
+ BLOCK_DEVICES = 0x8,
|
|
+ COLUMN = 0x10,
|
|
+ DBG = 0x20,
|
|
+ DUMP = 0x40,
|
|
+ DMERASE = 0x80,
|
|
+ GROUP = 0x100,
|
|
+#endif
|
|
+ HELP = 0x200,
|
|
+#ifndef DMRAID_MINI
|
|
+ LIST_FORMATS = 0x400,
|
|
+# ifdef DMRAID_NATIVE_LOG
|
|
+ NATIVE_LOG = 0x800,
|
|
+# endif
|
|
+#endif
|
|
+ NOPARTITIONS = 0x1000,
|
|
+#ifndef DMRAID_MINI
|
|
+ RAID_DEVICES = 0x2000,
|
|
+ RAID_SETS = 0x4000,
|
|
+ TEST = 0x8000,
|
|
+ VERBOSE = 0x10000,
|
|
+ ACTIVE = 0x20000,
|
|
+ INACTIVE = 0x40000,
|
|
+ SEPARATOR = 0x80000,
|
|
+#endif
|
|
+ VERSION = 0x100000,
|
|
+ IGNORELOCKING = 0x200000,
|
|
+#ifndef DMRAID_MINI
|
|
+ DEL_SETS = 0x400000,
|
|
+ CREATE = 0x800000,
|
|
+ REBUILD = 0x1000000,
|
|
+ SPARE = 0x2000000,
|
|
+ MEDIA = 0x4000000,
|
|
+ END_REBUILD = 0x8000000,
|
|
+ GET_MEMBERS = 0x10000000,
|
|
+ PARTCHAR = 0x20000000,
|
|
+
|
|
+#endif
|
|
+};
|
|
+
|
|
+enum metadata_need {
|
|
+ M_NONE = 0x00,
|
|
+ M_DEVICE = 0x01,
|
|
+ M_RAID = 0x02,
|
|
+ M_SET = 0x04,
|
|
+};
|
|
+
|
|
+enum id {
|
|
+ ROOT,
|
|
+ ANY_ID,
|
|
+};
|
|
+
|
|
+enum lock {
|
|
+ LOCK,
|
|
+ NO_LOCK,
|
|
+};
|
|
+
|
|
+/*
|
|
+ * Pre and Post functions to perform for an option.
|
|
+ */
|
|
+struct prepost {
|
|
+ enum action action;
|
|
+ enum metadata_need metadata;
|
|
+ enum id id;
|
|
+ enum lock lock;
|
|
+ int (*pre) (int arg);
|
|
+ int arg;
|
|
+ int (*post) (struct lib_context * lc, int arg);
|
|
+};
|
|
+
|
|
struct lib_version {
|
|
const char *text;
|
|
const char *date;
|
|
Index: 1.0.0.rc14/tools/commands.h
|
|
===================================================================
|
|
--- 1.0.0.rc14.orig/tools/commands.h 2005-09-27 15:39:44.000000000 +0200
|
|
+++ 1.0.0.rc14/tools/commands.h 2008-09-10 15:09:17.000000000 +0200
|
|
@@ -13,40 +13,6 @@
|
|
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
|
|
#define ARRAY_END(a) (a + ARRAY_SIZE(a))
|
|
|
|
-/* Options actions dmraid performs. */
|
|
-enum action {
|
|
- UNDEF = 0x0,
|
|
- ACTIVATE = 0x1,
|
|
- DEACTIVATE = 0x2,
|
|
- FORMAT = 0x4,
|
|
-#ifndef DMRAID_MINI
|
|
- BLOCK_DEVICES = 0x8,
|
|
- COLUMN = 0x10,
|
|
- DBG = 0x20,
|
|
- DUMP = 0x40,
|
|
- ERASE = 0x80,
|
|
- GROUP = 0x100,
|
|
-#endif
|
|
- HELP = 0x200,
|
|
-#ifndef DMRAID_MINI
|
|
- LIST_FORMATS = 0x400,
|
|
-# ifdef DMRAID_NATIVE_LOG
|
|
- NATIVE_LOG = 0x800,
|
|
-# endif
|
|
-#endif
|
|
- NOPARTITIONS = 0x1000,
|
|
-#ifndef DMRAID_MINI
|
|
- RAID_DEVICES = 0x2000,
|
|
- RAID_SETS = 0x4000,
|
|
- TEST = 0x8000,
|
|
- VERBOSE = 0x10000,
|
|
- ACTIVE = 0x20000,
|
|
- INACTIVE = 0x40000,
|
|
- SEPARATOR = 0x80000,
|
|
-#endif
|
|
- VERSION = 0x100000,
|
|
- IGNORELOCKING = 0x200000,
|
|
-};
|
|
|
|
#define ALL_FLAGS ((enum action) -1)
|
|
|
|
@@ -75,37 +41,6 @@
|
|
int arg; /* Argument for above function call */
|
|
};
|
|
|
|
-/* Define which metadata is needed before we can call post functions. */
|
|
-enum metadata_need {
|
|
- M_NONE = 0x00,
|
|
- M_DEVICE = 0x01,
|
|
- M_RAID = 0x02,
|
|
- M_SET = 0x04,
|
|
-};
|
|
-
|
|
-enum id {
|
|
- ROOT,
|
|
- ANY_ID,
|
|
-};
|
|
-
|
|
-enum lock {
|
|
- LOCK,
|
|
- NO_LOCK,
|
|
-};
|
|
-
|
|
-/*
|
|
- * Pre and Post functions to perform for an option.
|
|
- */
|
|
-struct prepost {
|
|
- enum action action;
|
|
- enum metadata_need metadata;
|
|
- enum id id;
|
|
- enum lock lock;
|
|
- int (*pre)(int arg);
|
|
- int arg;
|
|
- int (*post)(struct lib_context *lc, int arg);
|
|
-};
|
|
-
|
|
int handle_args(struct lib_context *lc, int argc, char ***argv);
|
|
int perform(struct lib_context *lc, char **argv);
|
|
|
|
Index: 1.0.0.rc14/tools/commands.c
|
|
===================================================================
|
|
--- 1.0.0.rc14.orig/tools/commands.c 2008-09-10 15:09:17.000000000 +0200
|
|
+++ 1.0.0.rc14/tools/commands.c 2008-09-10 15:09:39.000000000 +0200
|
|
@@ -243,7 +243,7 @@
|
|
|NATIVE_LOG
|
|
# endif
|
|
|RAID_DEVICES|RAID_SETS,
|
|
- ACTIVE|INACTIVE|COLUMN|DBG|DUMP|ERASE|GROUP|HELP|
|
|
+ ACTIVE|INACTIVE|COLUMN|DBG|DUMP|DMERASE|GROUP|HELP|
|
|
IGNORELOCKING|NOPARTITIONS|SEPARATOR|TEST|VERBOSE
|
|
#else
|
|
, UNDEF
|
|
@@ -314,7 +314,7 @@
|
|
|
|
/* Erase metadata option. */
|
|
{ 'E',
|
|
- ERASE,
|
|
+ DMERASE,
|
|
RAID_DEVICES,
|
|
COLUMN|DBG|FORMAT|HELP|IGNORELOCKING|SEPARATOR|VERBOSE,
|
|
ARGS,
|
|
@@ -381,7 +381,7 @@
|
|
{ 'r',
|
|
RAID_DEVICES,
|
|
UNDEF,
|
|
- COLUMN|DBG|DUMP|ERASE|FORMAT|HELP|IGNORELOCKING|SEPARATOR|VERBOSE,
|
|
+ COLUMN|DBG|DUMP|DMERASE|FORMAT|HELP|IGNORELOCKING|SEPARATOR|VERBOSE,
|
|
ARGS,
|
|
NULL,
|
|
0,
|
|
@@ -500,7 +500,7 @@
|
|
if ((action & (DBG|VERBOSE)) == action)
|
|
LOG_ERR(lc, 0, "More options needed with -d/-v");
|
|
|
|
- if (action & ERASE) {
|
|
+ if (action & DMERASE) {
|
|
action |= DUMP;
|
|
lc_inc_opt(lc, LC_DUMP);
|
|
}
|
|
@@ -697,7 +697,7 @@
|
|
},
|
|
|
|
/* Erase metadata. */
|
|
- { ERASE,
|
|
+ { DMERASE,
|
|
M_DEVICE|M_RAID,
|
|
ROOT,
|
|
LOCK,
|