summaryrefslogtreecommitdiffstats
path: root/sbin/geom/class/mirror
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-11-01 22:51:49 +0000
committerpjd <pjd@FreeBSD.org>2006-11-01 22:51:49 +0000
commitb34fb80d8364fbc4f1737da5f2916fe5b39a9325 (patch)
tree97b3734a2b0b5f3ef52ead534f66a992a2f04c67 /sbin/geom/class/mirror
parent3d8e2e0a6f357ed1a3f49941041c5850215bb15d (diff)
downloadFreeBSD-src-b34fb80d8364fbc4f1737da5f2916fe5b39a9325.zip
FreeBSD-src-b34fb80d8364fbc4f1737da5f2916fe5b39a9325.tar.gz
Now, that we have gjournal in the tree add possibility to configure
gmirror and graid3 in a way that it is not resynchronized after a power failure or system crash. It is safe when gjournal is running on top of gmirror/graid3.
Diffstat (limited to 'sbin/geom/class/mirror')
-rw-r--r--sbin/geom/class/mirror/geom_mirror.c14
-rw-r--r--sbin/geom/class/mirror/gmirror.812
2 files changed, 19 insertions, 7 deletions
diff --git a/sbin/geom/class/mirror/geom_mirror.c b/sbin/geom/class/mirror/geom_mirror.c
index 0ace733..7fc01cd 100644
--- a/sbin/geom/class/mirror/geom_mirror.c
+++ b/sbin/geom/class/mirror/geom_mirror.c
@@ -67,12 +67,14 @@ struct g_command class_commands[] = {
{ 'a', "autosync", NULL, G_TYPE_BOOL },
{ 'b', "balance", configure_balance, G_TYPE_STRING },
{ 'd', "dynamic", NULL, G_TYPE_BOOL },
+ { 'f', "failsync", NULL, G_TYPE_BOOL },
+ { 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'h', "hardcode", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 's', "slice", &configure_slice, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- "[-adhnv] [-b balance] [-s slice] name"
+ "[-adfFhnv] [-b balance] [-s slice] name"
},
{ "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS,
"[-v] name prov ..."
@@ -86,12 +88,13 @@ struct g_command class_commands[] = {
{ "label", G_FLAG_VERBOSE, mirror_main,
{
{ 'b', "balance", label_balance, G_TYPE_STRING },
+ { 'F', "nofailsync", NULL, G_TYPE_BOOL },
{ 'h', "hardcode", NULL, G_TYPE_BOOL },
{ 'n', "noautosync", NULL, G_TYPE_BOOL },
{ 's', "slice", &label_slice, G_TYPE_NUMBER },
G_OPT_SENTINEL
},
- "[-hnv] [-b balance] [-s slice] name prov ..."
+ "[-Fhnv] [-b balance] [-s slice] name prov ..."
},
{ "insert", G_FLAG_VERBOSE, NULL,
{
@@ -154,7 +157,7 @@ mirror_label(struct gctl_req *req)
unsigned sectorsize;
off_t mediasize;
intmax_t val;
- int error, i, nargs, bal, hardcode, noautosync;
+ int error, i, nargs, bal, hardcode;
nargs = gctl_get_int(req, "nargs");
if (nargs < 2) {
@@ -182,9 +185,10 @@ mirror_label(struct gctl_req *req)
return;
}
md.md_balance = bal;
- noautosync = gctl_get_int(req, "noautosync");
- if (noautosync)
+ if (gctl_get_int(req, "noautosync"))
md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOAUTOSYNC;
+ if (gctl_get_int(req, "nofailsync"))
+ md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOFAILSYNC;
hardcode = gctl_get_int(req, "hardcode");
/*
diff --git a/sbin/geom/class/mirror/gmirror.8 b/sbin/geom/class/mirror/gmirror.8
index a58212c..4d62f72 100644
--- a/sbin/geom/class/mirror/gmirror.8
+++ b/sbin/geom/class/mirror/gmirror.8
@@ -33,7 +33,7 @@
.Sh SYNOPSIS
.Nm
.Cm label
-.Op Fl hnv
+.Op Fl Fhnv
.Op Fl b Ar balance
.Op Fl s Ar slice
.Ar name
@@ -44,7 +44,7 @@
.Ar prov ...
.Nm
.Cm configure
-.Op Fl adhnv
+.Op Fl adfFhnv
.Op Fl b Ar balance
.Op Fl s Ar slice
.Ar name
@@ -142,6 +142,9 @@ Split read requests, which are bigger than or equal to slice size on N pieces,
where N is the number of active components.
This is the default balance algorithm.
.El
+.It Fl F
+Do not synchronize after a power failure or system crash.
+Assumes device is in consistent state.
.It Fl h
Hardcode providers' names in metadata.
.It Fl n
@@ -167,6 +170,11 @@ Turn on autosynchronization of stale components.
Specifies balance algorithm to use.
.It Fl d
Do not hardcode providers' names in metadata.
+.It Fl f
+Synchronize device after a power failure or system crash.
+.It Fl F
+Do not synchronize after a power failure or system crash.
+Assumes device is in consistent state.
.It Fl h
Hardcode providers' names in metadata.
.It Fl n
OpenPOWER on IntegriCloud