summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class/raid3
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-09-13 13:48:18 +0000
committerpjd <pjd@FreeBSD.org>2010-09-13 13:48:18 +0000
commit3d8ce965d3cc7199c39bd29a375291b4276bab53 (patch)
tree80fa9ced0ed4ae38bb90b62555eb33be45347414 /sbin/geom/class/raid3
parent7dc7517414123c9d33d848a1cb615f3adbb59e51 (diff)
downloadFreeBSD-src-3d8ce965d3cc7199c39bd29a375291b4276bab53.zip
FreeBSD-src-3d8ce965d3cc7199c39bd29a375291b4276bab53.tar.gz
- Remove gc_argname field. It was introduced for gpart(8), but if I
understand everything correctly, we don't really need it. - Provide default numeric value as strings. This allows to simplify a lot of code. - Bump version number.
Diffstat (limited to 'sbin/geom/class/raid3')
-rw-r--r--sbin/geom/class/raid3/geom_raid3.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sbin/geom/class/raid3/geom_raid3.c b/sbin/geom/class/raid3/geom_raid3.c
index 89ce168..220fb09 100644
--- a/sbin/geom/class/raid3/geom_raid3.c
+++ b/sbin/geom/class/raid3/geom_raid3.c
@@ -45,15 +45,13 @@ __FBSDID("$FreeBSD$");
uint32_t lib_version = G_LIB_VERSION;
uint32_t version = G_RAID3_VERSION;
-static intmax_t default_blocksize = 0;
-
static void raid3_main(struct gctl_req *req, unsigned f);
static void raid3_clear(struct gctl_req *req);
static void raid3_dump(struct gctl_req *req);
static void raid3_label(struct gctl_req *req);
struct g_command class_commands[] = {
- { "clear", G_FLAG_VERBOSE, raid3_main, G_NULL_OPTS, NULL,
+ { "clear", G_FLAG_VERBOSE, raid3_main, G_NULL_OPTS,
"[-v] prov ..."
},
{ "configure", G_FLAG_VERBOSE, NULL,
@@ -70,9 +68,9 @@ struct g_command class_commands[] = {
{ 'W', "noverify", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL
},
- NULL, "[-adfFhnrRvwW] name"
+ "[-adfFhnrRvwW] name"
},
- { "dump", 0, raid3_main, G_NULL_OPTS, NULL,
+ { "dump", 0, raid3_main, G_NULL_OPTS,
"prov ..."
},
{ "insert", G_FLAG_VERBOSE, NULL,
@@ -81,7 +79,7 @@ struct g_command class_commands[] = {
{ 'n', "number", NULL, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- NULL, "[-hv] <-n number> name prov"
+ "[-hv] <-n number> name prov"
},
{ "label", G_FLAG_VERBOSE, raid3_main,
{
@@ -89,13 +87,13 @@ struct g_command class_commands[] = {
{ 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 'r', "round_robin", NULL, G_TYPE_BOOL },
- { 's', "blocksize", &default_blocksize, G_TYPE_NUMBER },
+ { 's', "sectorsize", "0", G_TYPE_NUMBER },
{ 'w', "verify", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL
},
- NULL, "[-hFnrvw] [-s blocksize] name prov prov prov ..."
+ "[-hFnrvw] [-s blocksize] name prov prov prov ..."
},
- { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL,
+ { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
"[-v] name prov"
},
{ "remove", G_FLAG_VERBOSE, NULL,
@@ -103,14 +101,14 @@ struct g_command class_commands[] = {
{ 'n', "number", NULL, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- NULL, "[-v] <-n number> name"
+ "[-v] <-n number> name"
},
{ "stop", G_FLAG_VERBOSE, NULL,
{
{ 'f', "force", NULL, G_TYPE_BOOL },
G_OPT_SENTINEL
},
- NULL, "[-fv] name ..."
+ "[-fv] name ..."
},
G_CMD_SENTINEL
};
@@ -193,7 +191,7 @@ raid3_label(struct gctl_req *req)
* sectorsizes of every disk and find the smallest mediasize.
*/
mediasize = 0;
- sectorsize = gctl_get_intmax(req, "blocksize");
+ sectorsize = gctl_get_intmax(req, "sectorsize");
for (i = 1; i < nargs; i++) {
str = gctl_get_ascii(req, "arg%d", i);
msize = g_get_mediasize(str);
OpenPOWER on IntegriCloud