summaryrefslogtreecommitdiffstats
path: root/sys/geom/mirror/g_mirror_ctl.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2004-07-31 00:54:44 +0000
committerpjd <pjd@FreeBSD.org>2004-07-31 00:54:44 +0000
commit0d74239c0036a9cdc8e207955d254d863844fdd0 (patch)
tree1e2bd8a198976acda9030ee534251189c83ad331 /sys/geom/mirror/g_mirror_ctl.c
parent8c9f26b7ea5ea9e9ecd17a9dbc6abb73549d694b (diff)
downloadFreeBSD-src-0d74239c0036a9cdc8e207955d254d863844fdd0.zip
FreeBSD-src-0d74239c0036a9cdc8e207955d254d863844fdd0.tar.gz
Add '-p' option for 'insert' command which allows to specify priority
of the new component. Version number wasn't bumped (it should be), because I think there are no geom_mirror users yet.
Diffstat (limited to 'sys/geom/mirror/g_mirror_ctl.c')
-rw-r--r--sys/geom/mirror/g_mirror_ctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/geom/mirror/g_mirror_ctl.c b/sys/geom/mirror/g_mirror_ctl.c
index 3685901..d69c445 100644
--- a/sys/geom/mirror/g_mirror_ctl.c
+++ b/sys/geom/mirror/g_mirror_ctl.c
@@ -252,6 +252,7 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_class *mp)
struct g_mirror_metadata md;
struct g_provider *pp;
struct g_consumer *cp;
+ intmax_t *priority;
const char *name;
char param[16];
u_char *sector;
@@ -272,6 +273,11 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_class *mp)
gctl_error(req, "Too few arguments.");
return;
}
+ priority = gctl_get_paraml(req, "priority", sizeof(*priority));
+ if (priority == NULL) {
+ gctl_error(req, "No '%s' argument.", "priority");
+ return;
+ }
inactive = gctl_get_paraml(req, "inactive", sizeof(*inactive));
if (inactive == NULL) {
gctl_error(req, "No '%s' argument.", "inactive");
@@ -346,6 +352,7 @@ again:
if (disks[i].consumer == NULL)
continue;
g_mirror_fill_metadata(sc, NULL, &md);
+ md.md_priority = *priority;
if (*inactive)
md.md_dflags |= G_MIRROR_DISK_FLAG_INACTIVE;
pp = disks[i].provider;
OpenPOWER on IntegriCloud