summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-11-04 00:35:31 +0100
committerNeilBrown <neilb@suse.de>2008-11-04 00:35:31 +0100
commit6be1d39d1dafce71c9c7f5bc74ef3fbd30e3765e (patch)
treed2a72a97977794d6bcfb42402b7e7a0bf4012730 /mdadm.c
parentRename open_mddev to create_mddev (diff)
downloadmdadm-6be1d39d1dafce71c9c7f5bc74ef3fbd30e3765e.tar.xz
mdadm-6be1d39d1dafce71c9c7f5bc74ef3fbd30e3765e.zip
Introduce new open_mddev which just does an open.
Some cases we aren't interested in creating the mddev, just opening it. Make those more explicit. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mdadm.c b/mdadm.c
index fb52b141..b33f605b 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -943,8 +943,9 @@ int main(int argc, char *argv[])
exit(2);
}
if (mode == MANAGE || mode == GROW)
- autof=1; /* Don't create */
- mdfd = create_mddev(devlist->devname, autof);
+ mdfd = open_mddev(devlist->devname, 1);
+ else
+ mdfd = create_mddev(devlist->devname, autof);
if (mdfd < 0)
exit(1);
if ((int)ident.super_minor == -2) {
@@ -1242,7 +1243,7 @@ int main(int argc, char *argv[])
e->dev);
continue;
}
- mdfd = create_mddev(name, 1);
+ mdfd = open_mddev(name, 1);
if (mdfd >= 0) {
if (Manage_runstop(name, mdfd, -1, quiet?1:last?0:-1))
err = 1;
@@ -1279,7 +1280,7 @@ int main(int argc, char *argv[])
case Waitclean:
rv |= WaitClean(dv->devname, verbose-quiet); continue;
}
- mdfd = create_mddev(dv->devname, 1);
+ mdfd = open_mddev(dv->devname, 1);
if (mdfd>=0) {
switch(dv->disposition) {
case 'R':