]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Assemble: revert preliminary -As support
authorDan Williams <dan.j.williams@intel.com>
Tue, 4 Nov 2008 09:51:11 +0000 (20:51 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 4 Nov 2008 09:51:11 +0000 (20:51 +1100)
I have seen the light.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Assemble.c
mdadm.h
mdmon.c
util.c

index b09021fca5e881752699e7a089cdfecf6f2630c0..6b1e8df10e844a4b901a3c0da11ae9be2e655435 100644 (file)
@@ -167,52 +167,6 @@ int Assemble(struct supertype *st, char *mddev,
                return 1;
        }
 
-       /* if the configuration specifies a container then we use that to
-        * determine the devices and retrieve the array configuration
-        */
-#ifndef MDASSEMBLE
-       if (ident->container && ident->member) {
-               int cfd = open(ident->container, O_RDWR);
-               struct mdinfo *mdi;
-               struct supertype container;
-
-               if (verbose>0)
-                       fprintf(stderr, Name ": looking to assemble member array %s"
-                               " inside container %s\n", ident->member, ident->container);
-               if (cfd < 0) {
-                       if (verbose>0)
-                               fprintf(stderr, Name ": unable to open container %s: %s\n",
-                                       ident->container, strerror(errno));
-                       return 1;
-               }
-
-               mdi = sysfs_read(cfd, fd2devnum(cfd), GET_VERSION);
-               if (!mdi) {
-                       close(cfd);
-                       if (verbose>0)
-                               fprintf(stderr, Name ": unable to read container %s\n",
-                                       ident->container);
-                       return 1;
-               }
-               container.ss = find_metadata_methods(mdi->text_version);
-               sysfs_free(mdi);
-               if (!container.ss) {
-                       close(cfd);
-                       fprintf(stderr, Name ": %s uses unknown metadata: %s\n",
-                               ident->container, mdi->text_version);
-                       return 1;
-               }
-               if (container.ss->load_super(&container, cfd, ident->container)) {
-                       fprintf(stderr, Name ": Cannot load metadata for container %s\n",
-                               ident->container);
-                       return 1;
-               }
-
-               return Incremental_container(&container, ident->container,
-                                            verbose, runstop, ident->autof,
-                                            LOCAL);
-       }
-#endif
        if (devlist == NULL)
                devlist = conf_get_devs();
        else if (mddev)
diff --git a/mdadm.h b/mdadm.h
index bc12d68bca03aac40ab70a269c1e19ff6aca43b3..541c43418a5529918df0b0dd5ff9df1534510e80 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -789,7 +789,6 @@ extern unsigned long long calc_array_size(int level, int raid_disks, int layout,
                                   int chunksize, unsigned long long devsize);
 extern int flush_metadata_updates(struct supertype *st);
 extern void append_metadata_update(struct supertype *st, void *buf, int len);
-extern struct superswitch *find_metadata_methods(char *vers);
 
 extern int add_disk(int mdfd, struct supertype *st,
                    struct mdinfo *sra, struct mdinfo *info);
diff --git a/mdmon.c b/mdmon.c
index cb4173a020dc51549478fdf1b0e1899b2ad7c2cf..fa5a0df9cd9452c1f15d445cfa52a1e6ff0d1308 100644 (file)
--- a/mdmon.c
+++ b/mdmon.c
@@ -92,6 +92,15 @@ int clone_monitor(struct supertype *container)
        return mon_tid;
 }
 
+static struct superswitch *find_metadata_methods(char *vers)
+{
+       if (strcmp(vers, "ddf") == 0)
+               return &super_ddf;
+       if (strcmp(vers, "imsm") == 0)
+               return &super_imsm;
+       return NULL;
+}
+
 
 int make_pidfile(char *devname, int o_excl)
 {
diff --git a/util.c b/util.c
index 1806e08f6978e071f1084cbfd0fe7318e47f9cee..f15ba43d44953974979b7f09c4ce9fa3c6a47fa2 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1299,15 +1299,6 @@ void append_metadata_update(struct supertype *st, void *buf, int len)
        *st->update_tail = mu;
        st->update_tail = &mu->next;
 }
-
-struct superswitch *find_metadata_methods(char *vers)
-{
-       if (strcmp(vers, "ddf") == 0)
-               return &super_ddf;
-       if (strcmp(vers, "imsm") == 0)
-               return &super_imsm;
-       return NULL;
-}
 #endif /* MDASSEMBLE */
 
 #ifdef __TINYC__