diff options
author | trasz <trasz@FreeBSD.org> | 2009-01-10 17:17:18 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2009-01-10 17:17:18 +0000 |
commit | 81e2127caa15f88bbc558045f3e1f33aec350e64 (patch) | |
tree | b5a421ef7bd7a2655743bae7cfbc5f273ae7d333 /sbin/mdconfig | |
parent | 2715f5ad3158486844c88030e49438d3e4b418f9 (diff) | |
download | FreeBSD-src-81e2127caa15f88bbc558045f3e1f33aec350e64.zip FreeBSD-src-81e2127caa15f88bbc558045f3e1f33aec350e64.tar.gz |
Add the possibility to specify "-o force" with "mdconfig -du".
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r-- | sbin/mdconfig/mdconfig.8 | 1 | ||||
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/sbin/mdconfig/mdconfig.8 b/sbin/mdconfig/mdconfig.8 index 28c17c5..0288474 100644 --- a/sbin/mdconfig/mdconfig.8 +++ b/sbin/mdconfig/mdconfig.8 @@ -62,6 +62,7 @@ .Nm .Fl d .Fl u Ar unit +.Op Fl o Oo Cm no Oc Ns Ar force .Nm .Fl l .Op Fl n diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index d1abf68..107a259 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -58,7 +58,7 @@ usage() "usage: mdconfig -a -t type [-n] [-o [no]option] ... [-f file]\n" " [-s size] [-S sectorsize] [-u unit]\n" " [-x sectors/track] [-y heads/cyl]\n" -" mdconfig -d -u unit\n" +" mdconfig -d -u unit [-o [no]force]\n" " mdconfig -l [-v] [-n] [-u unit]\n"); fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n"); fprintf(stderr, "\t\toption = {cluster, compress, reserve}\n"); @@ -160,6 +160,16 @@ main(int argc, char **argv) close(fd); break; case 'o': + if (action == DETACH) { + if (!strcmp(optarg, "force")) + mdio.md_options |= MD_FORCE; + else if (!strcmp(optarg, "noforce")) + mdio.md_options &= ~MD_FORCE; + else + errx(1, "Unknown option: %s.", optarg); + break; + } + if (cmdline != 2) usage(); if (!strcmp(optarg, "async")) |