]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Rename open_mddev to create_mddev
authorNeilBrown <neilb@suse.de>
Mon, 3 Nov 2008 23:35:10 +0000 (10:35 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 3 Nov 2008 23:35:10 +0000 (10:35 +1100)
This reflect that fact that more often than not it is creating things
in /dev, and allows for a new open_mddev which does just that.

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c
Incremental.c
mdadm.c
mdadm.h
mdassemble.c
mdopen.c

index 526b1d5a1aa67a9616f89b5c8f77bc3441d04d33..fa534fd263c6de09a5f3900795beba064ad6017e 100644 (file)
@@ -437,7 +437,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
        if (mdfd < 0) {
                /* So... it is up to me to open the device.
                 * We create a name '/dev/md/XXX' based on the info in the
-                * superblock, and call open_mddev on that
+                * superblock, and call create_mddev on that
                 */
                mdu_array_info_t inf;
                char *c;
@@ -462,7 +462,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                if (rc < 0)
                        mdfd = -1;
                else
-                       mdfd = open_mddev(mddev, ident->autof);
+                       mdfd = create_mddev(mddev, ident->autof);
                if (mdfd < 0) {
                        st->ss->free_super(st);
                        free(devices);
index 8619c28e02e097669f7728356b8cb45d6ab71573..08960a5f5fde3664197b7b65d96603eace4a6f59 100644 (file)
@@ -311,7 +311,7 @@ int Incremental(char *devname, int verbose, int runstop,
                        devnum = use_partitions ? (-1-devnum) : devnum;
        }
 
-       mdfd = open_mddev_devnum(match ? match->devname : mp ? mp->path : NULL,
+       mdfd = create_mddev_devnum(match ? match->devname : mp ? mp->path : NULL,
                                 devnum,
                                 name_to_use,
                                 chosen_name, autof >> 3);
@@ -714,7 +714,7 @@ int IncrementalScan(int verbose)
                mdu_array_info_t array;
                mdu_bitmap_file_t bmf;
                struct mdinfo *sra;
-               int mdfd = open_mddev_devnum(me->path, me->devnum,
+               int mdfd = create_mddev_devnum(me->path, me->devnum,
                                             NULL, path, 0);
                if (mdfd < 0)
                        continue;
@@ -898,7 +898,7 @@ int Incremental_container(struct supertype *st, char *devname, int verbose,
                        else
                                devnum = find_free_devnum(usepart);
                }
-               mdfd = open_mddev_devnum(mp ? mp->path : match ? match->devname : NULL,
+               mdfd = create_mddev_devnum(mp ? mp->path : match ? match->devname : NULL,
                                         devnum, name_to_use,
                                         chosen_name, autof>>3);
 
diff --git a/mdadm.c b/mdadm.c
index 975922044a7d6459b08f47c22d1d585b0841bf01..fb52b141a1dbc3ab356ba2f78b255152d1f4d50f 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -944,7 +944,7 @@ int main(int argc, char *argv[])
                }
                if (mode == MANAGE || mode == GROW)
                        autof=1; /* Don't create */
-               mdfd = open_mddev(devlist->devname, autof);
+               mdfd = create_mddev(devlist->devname, autof);
                if (mdfd < 0)
                        exit(1);
                if ((int)ident.super_minor == -2) {
@@ -1008,7 +1008,7 @@ int main(int argc, char *argv[])
                                        devlist->devname);
                                rv |= 1;
                        } else {
-                               mdfd = open_mddev(devlist->devname,
+                               mdfd = create_mddev(devlist->devname,
                                                  array_ident->autof ? array_ident->autof : autof);
                                if (mdfd < 0)
                                        rv |= 1;
@@ -1040,7 +1040,7 @@ int main(int argc, char *argv[])
                                        rv |= 1;
                                        continue;
                                }
-                               mdfd = open_mddev(dv->devname,
+                               mdfd = create_mddev(dv->devname,
                                                  array_ident->autof ?array_ident->autof : autof);
                                if (mdfd < 0) {
                                        rv |= 1;
@@ -1069,7 +1069,7 @@ int main(int argc, char *argv[])
                        }
                        for (; array_list; array_list = array_list->next) {
                                mdu_array_info_t array;
-                               mdfd = open_mddev(array_list->devname,
+                               mdfd = create_mddev(array_list->devname,
                                                  array_list->autof ? array_list->autof : autof);
                                if (mdfd < 0) {
                                        rv |= 1;
@@ -1242,7 +1242,7 @@ int main(int argc, char *argv[])
                                                                        e->dev);
                                                                continue;
                                                        }
-                                                       mdfd = open_mddev(name, 1);
+                                                       mdfd = create_mddev(name, 1);
                                                        if (mdfd >= 0) {
                                                                if (Manage_runstop(name, mdfd, -1, quiet?1:last?0:-1))
                                                                        err = 1;
@@ -1279,7 +1279,7 @@ int main(int argc, char *argv[])
                                case Waitclean:
                                        rv |= WaitClean(dv->devname, verbose-quiet); continue;
                                }
-                               mdfd = open_mddev(dv->devname, 1);
+                               mdfd = create_mddev(dv->devname, 1);
                                if (mdfd>=0) {
                                        switch(dv->disposition) {
                                        case 'R':
diff --git a/mdadm.h b/mdadm.h
index 4b006fb6884c108871d3539a25f81d0f168af6c6..8527bbb15d6967d3f9d30f0cc60c3d6ea7ab648f 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -801,8 +801,8 @@ extern char *get_md_name(int dev);
 
 extern char DefaultConfFile[];
 
-extern int open_mddev(char *dev, int autof);
-extern int open_mddev_devnum(char *devname, int devnum, char *name,
+extern int create_mddev(char *dev, int autof);
+extern int create_mddev_devnum(char *devname, int devnum, char *name,
                             char *chosen_name, int parts);
 extern int open_container(int fd);
 
index b0d87b8362e7ceee98571d7ae9ceff12f71ba526..66d82131e1c65d3020333fa3a0d67b30e57bf680 100644 (file)
@@ -55,7 +55,7 @@ mapping_t pers[] = {
 
 #ifndef MDASSEMBLE_AUTO
 /* from mdopen.c */
-int open_mddev(char *dev, int autof/*unused */)
+int create_mddev(char *dev, int autof/*unused */)
 {
        int mdfd = open(dev, O_RDWR);
        if (mdfd < 0)
@@ -86,7 +86,7 @@ int main(int argc, char *argv[]) {
        } else
                for (; array_list; array_list = array_list->next) {
                        mdu_array_info_t array;
-                       mdfd = open_mddev(array_list->devname, array_list->autof);
+                       mdfd = create_mddev(array_list->devname, array_list->autof);
                        if (mdfd < 0) {
                                rv |= 1;
                                continue;
index eee1eea15f049c734e47cb09c0fd524da5f94373..515683599078b4d25927e826ab96135b8f66f8bd 100644 (file)
--- a/mdopen.c
+++ b/mdopen.c
@@ -106,7 +106,7 @@ void make_parts(char *dev, int cnt, int symlinks)
  * If it now doesn't exist, we find a new md array and create the device.
  * Default ownership/mode comes from config file.
  */
-int open_mddev(char *dev, int autof)
+int create_mddev(char *dev, int autof)
 {
        int mdfd;
        struct stat stb;
@@ -268,7 +268,7 @@ int open_mddev(char *dev, int autof)
 }
 
 
-int open_mddev_devnum(char *devname, int devnum, char *name,
+int create_mddev_devnum(char *devname, int devnum, char *name,
                      char *chosen_name, int parts)
 {
        /* Open the md device with number 'devnum', possibly using 'devname',