summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2010-05-05 18:22:29 +0000
committermm <mm@FreeBSD.org>2010-05-05 18:22:29 +0000
commita0a9776a5cd835b11247f9190d1b1005b828c7ed (patch)
treed92855d569f6a5da86c251d5422043d5110edb78 /cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
parent5c7ca3ee73eb98150c91a44001daf8ac7adb0907 (diff)
downloadFreeBSD-src-a0a9776a5cd835b11247f9190d1b1005b828c7ed.zip
FreeBSD-src-a0a9776a5cd835b11247f9190d1b1005b828c7ed.tar.gz
Introduce hardforce export option (-F) for "zpool export".
When exporting with this flag, zpool.cache remains untouched. OpenSolaris onnv revision: 8211:32722be6ad3b Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID: 6775357)
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zpool/zpool_main.c')
-rw-r--r--cddl/contrib/opensolaris/cmd/zpool/zpool_main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
index 2970371..eef60e6 100644
--- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
@@ -879,17 +879,21 @@ int
zpool_do_export(int argc, char **argv)
{
boolean_t force = B_FALSE;
+ boolean_t hardforce = B_FALSE;
int c;
zpool_handle_t *zhp;
int ret;
int i;
/* check options */
- while ((c = getopt(argc, argv, "f")) != -1) {
+ while ((c = getopt(argc, argv, "fF")) != -1) {
switch (c) {
case 'f':
force = B_TRUE;
break;
+ case 'F':
+ hardforce = B_TRUE;
+ break;
case '?':
(void) fprintf(stderr, gettext("invalid option '%c'\n"),
optopt);
@@ -919,8 +923,12 @@ zpool_do_export(int argc, char **argv)
continue;
}
- if (zpool_export(zhp, force) != 0)
+ if (hardforce) {
+ if (zpool_export_force(zhp) != 0)
+ ret = 1;
+ } else if (zpool_export(zhp, force) != 0) {
ret = 1;
+ }
zpool_close(zhp);
}
OpenPOWER on IntegriCloud