diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2004-07-31 00:54:44 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2004-07-31 00:54:44 +0000 |
commit | 55d6eb9fef37de85ba595146e4dda73d25fba9c5 (patch) | |
tree | 1e2bd8a198976acda9030ee534251189c83ad331 /sys | |
parent | ff9160f5f378604baf5de70e6b430407070aee2e (diff) | |
download | src-55d6eb9fef37de85ba595146e4dda73d25fba9c5.tar.gz src-55d6eb9fef37de85ba595146e4dda73d25fba9c5.zip |
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.
Notes
Notes:
svn path=/head/; revision=132909
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/mirror/g_mirror_ctl.c | 7 |
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 36859010ffab..d69c44595ec8 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; |