diff options
author | ru <ru@FreeBSD.org> | 2006-11-03 12:02:24 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-11-03 12:02:24 +0000 |
commit | d23275fe7d190eab56c82bf462ecb67346e58ab3 (patch) | |
tree | 456b7fc1c673cd53fde90ad1cc513fb78e6002f2 /sbin/mdmfs/mdmfs.c | |
parent | bac59c3a27ebec7c9594a2835e8991984f853c30 (diff) | |
download | FreeBSD-src-d23275fe7d190eab56c82bf462ecb67346e58ab3.zip FreeBSD-src-d23275fe7d190eab56c82bf462ecb67346e58ab3.tar.gz |
Remove the -C option as it does more harm than good. To be fully
compatible, it would have to (at least):
- support the "compat-compat" -T option,
- *not* support the -l, -O, and -v options,
- default to soft updates being disabled.
Worse, the compatibility mode makes it impossible to mount_mfs(8)
a file system from fstab(5) with soft updates disabled (-S). [1]
Now, the only difference when called as "mount_mfs" or "mfs" (as
opposed to "mdmfs") is that the file mode of the mount point is
set by default to 01777. All options available to mdmfs(8) are
also available to mount_mfs(8); the -C option is still recognized
but ignored for backward compatibility.
PR: bin/98860 [1]
MFC after: 2 weeks
Diffstat (limited to 'sbin/mdmfs/mdmfs.c')
-rw-r--r-- | sbin/mdmfs/mdmfs.c | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c index e23d525..c07be21 100644 --- a/sbin/mdmfs/mdmfs.c +++ b/sbin/mdmfs/mdmfs.c @@ -61,7 +61,6 @@ struct mtpt_info { bool mi_have_mode; }; -static bool compat; /* Full compatibility with mount_mfs? */ static bool debug; /* Emit debugging information? */ static bool loudsubs; /* Suppress output from helper programs? */ static bool norun; /* Actually run the helper programs? */ @@ -119,8 +118,11 @@ main(int argc, char **argv) /* If we were started as mount_mfs or mfs, imply -C. */ if (strcmp(getprogname(), "mount_mfs") == 0 || - strcmp(getprogname(), "mfs") == 0) - compat = true; + strcmp(getprogname(), "mfs") == 0) { + /* Make compatibility assumptions. */ + mi.mi_mode = 01777; + mi.mi_have_mode = true; + } while ((ch = getopt(argc, argv, "a:b:Cc:Dd:E:e:F:f:hi:LlMm:Nn:O:o:Pp:Ss:t:Uv:w:X")) != -1) @@ -132,16 +134,12 @@ main(int argc, char **argv) argappend(&newfs_arg, "-b %s", optarg); break; case 'C': - if (compat) - usage(); - compat = true; + /* Ignored for compatibility. */ break; case 'c': argappend(&newfs_arg, "-c %s", optarg); break; case 'D': - if (compat) - usage(); detach = false; break; case 'd': @@ -170,8 +168,6 @@ main(int argc, char **argv) argappend(&newfs_arg, "-i %s", optarg); break; case 'L': - if (compat) - usage(); loudsubs = true; break; case 'l': @@ -187,8 +183,6 @@ main(int argc, char **argv) argappend(&newfs_arg, "-m %s", optarg); break; case 'N': - if (compat) - usage(); norun = true; break; case 'n': @@ -201,13 +195,9 @@ main(int argc, char **argv) argappend(&mount_arg, "-o %s", optarg); break; case 'P': - if (compat) - usage(); newfs = false; break; case 'p': - if (compat) - usage(); if ((set = setmode(optarg)) == NULL) usage(); mi.mi_mode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); @@ -215,8 +205,6 @@ main(int argc, char **argv) free(set); break; case 'S': - if (compat) - usage(); softdep = false; break; case 's': @@ -229,13 +217,9 @@ main(int argc, char **argv) argappend(&newfs_arg, "-O %s", optarg); break; case 'w': - if (compat) - usage(); extract_ugid(optarg, &mi); break; case 'X': - if (compat) - usage(); debug = true; break; default: @@ -246,12 +230,6 @@ main(int argc, char **argv) if (argc < 2) usage(); - /* Make compatibility assumptions. */ - if (compat) { - mi.mi_mode = 01777; - mi.mi_have_mode = true; - } - /* Derive 'unit' (global). */ unitstr = argv[0]; if (strncmp(unitstr, "/dev/", 5) == 0) @@ -671,23 +649,12 @@ run(int *ofd, const char *cmdline, ...) static void usage(void) { - const char *name; - if (compat) - name = getprogname(); - else - name = "mdmfs"; - if (!compat) - fprintf(stderr, + fprintf(stderr, "usage: %s [-DLlMNPSUX] [-a maxcontig] [-b block-size] [-c cylinders]\n" "\t[-d rotdelay] [-E path-mdconfig] [-e maxbpg] [-F file] [-f frag-size]\n" "\t[-i bytes] [-m percent-free] [-n rotational-positions] [-O optimization]\n" "\t[-o mount-options] [-p permissions] [-s size] [-v version]\n" -"\t[-w user:group] md-device mount-point\n", name); - fprintf(stderr, -"usage: %s -C [-lNU] [-a maxcontig] [-b block-size] [-c cylinders]\n" -"\t[-d rotdelay] [-E path-mdconfig] [-e maxbpg] [-F file] [-f frag-size]\n" -"\t[-i bytes] [-m percent-free] [-n rotational-positions] [-O optimization]\n" -"\t[-o mount-options] [-s size] [-v version] md-device mount-point\n", name); +"\t[-w user:group] md-device mount-point\n", getprogname()); exit(1); } |