diff options
author | Neil Brown <neilb@suse.de> | 2006-05-16 07:35:06 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-05-16 07:35:06 +0000 |
commit | f1ae21c411252787089618fc4a36bd5f06cc8917 (patch) | |
tree | cb0f7d3c0c78be1815a9fb9b7537363621a4d753 /mdadm.c | |
parent | 8131b493df02ad22c8600f4c99d97003a807e5a7 (diff) | |
download | mdadm-f1ae21c411252787089618fc4a36bd5f06cc8917.tar.gz mdadm-f1ae21c411252787089618fc4a36bd5f06cc8917.tar.xz mdadm-f1ae21c411252787089618fc4a36bd5f06cc8917.zip |
Arrange the 'auto' setting in mdadm.conf can choose default type.
So when you say auto=md or auto=part in mdadm.conf, it give a preference
for type of array, but standard name will override.
But --auto=md is more insistant.
FIXME I'm not at all happy about handling of names that already exist.
I don't think that should be removed if the device is active.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -75,15 +75,17 @@ int main(int argc, char *argv[]) int force = 0; int test = 0; int assume_clean = 0; - int autof = 0; /* -3 means don't create anything, - * -2 means create device based on name: - * if it ends mdN, then non-partitioned array N - * if it ends dN, then partitions array N - * -1 means create non-partitioned, choose N - * 1 or more to create partitioned - * If -1 or 1 and name is a 'standard' name, then - * insist on a match of type and number. - */ + /* autof indicates whether and how to create device node. + * bottom 3 bits are style. Rest (when shifted) are number of parts + * 0 - unset + * 1 - don't create (no) + * 2 - if is_standard, then create (yes) + * 3 - create as 'md' - reject is_standard mdp (md) + * 4 - create as 'mdp' - reject is_standard md (mdp) + * 5 - default to md if not is_standard (md in config file) + * 6 - default to mdp if not is_standard (part, or mdp in config file) + */ + int autof = 0; char *mailaddr = NULL; char *program = NULL; @@ -483,7 +485,7 @@ int main(int argc, char *argv[]) case O(CREATE,'a'): case O(BUILD,'a'): case O(ASSEMBLE,'a'): /* auto-creation of device node */ - autof = parse_auto(optarg, "--auto flag"); + autof = parse_auto(optarg, "--auto flag", 0); continue; case O(BUILD,'f'): /* force honouring '-n 1' */ |