X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=mdassemble.c;h=674be11f45e0ca3c527aaf4b9579dd2f84d6bf46;hb=0448027b765ec7ede580a1630c23fe7cf4bd0b05;hp=45ff9c57526af875f7048366a0edda2b1a3debb2;hpb=8320878543bb5e49b5acb24fa919ff11be485c61;p=thirdparty%2Fmdadm.git diff --git a/mdassemble.c b/mdassemble.c index 45ff9c57..674be11f 100644 --- a/mdassemble.c +++ b/mdassemble.c @@ -1,7 +1,7 @@ /* * mdassemble - assemble Linux "md" devices aka RAID arrays. * - * Copyright (C) 2001-2006 Neil Brown + * Copyright (C) 2001-2009 Neil Brown * Copyright (C) 2003 Luca Berra * * @@ -20,49 +20,22 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Neil Brown - * Email: - * Paper: Neil Brown - * School of Computer Science and Engineering - * The University of New South Wales - * Sydney, 2052 - * Australia + * Email: */ #include "mdadm.h" #include "md_p.h" -/* from readme.c */ -mapping_t pers[] = { - { "linear", -1}, - { "raid0", 0}, - { "0", 0}, - { "stripe", 0}, - { "raid1", 1}, - { "1", 1}, - { "mirror", 1}, - { "raid4", 4}, - { "4", 4}, - { "raid5", 5}, - { "5", 5}, - { "multipath", -4}, - { "mp", -4}, - { "raid6", 6}, - { "6", 6}, - { "raid10", 10}, - { "10", 10}, - { NULL, 0} -}; - #ifndef MDASSEMBLE_AUTO /* from mdopen.c */ int open_mddev(char *dev, int report_errors/*unused*/) { int mdfd = open(dev, O_RDWR); if (mdfd < 0) - fprintf(stderr, Name ": error opening %s: %s\n", + pr_err("error opening %s: %s\n", dev, strerror(errno)); else if (md_get_version(mdfd) <= 0) { - fprintf(stderr, Name ": %s does not appear to be an md device\n", + pr_err("%s does not appear to be an md device\n", dev); close(mdfd); mdfd = -1; @@ -75,7 +48,7 @@ int create_mddev(char *dev, char *name, int autof/*unused*/, int trustworthy, return open_mddev(dev, 0); } #endif -int map_update(struct map_ent **mpp, int devnum, char *metadata, +int map_update(struct map_ent **mpp, char *devnm, char *metadata, int *uuid, char *path) { return 0; @@ -84,18 +57,19 @@ struct map_ent *map_by_name(struct map_ent **mpp, char *name) { return NULL; } +int map_lock(struct map_ent **melp){return 0;} +void map_unlock(struct map_ent **melp){} +struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]){return NULL;} int rv; int mdfd = -1; -int runstop = 0; -int readonly = 0; -int verbose = 0; -int force = 0; -int main(int argc, char *argv[]) { - mddev_ident_t array_list = conf_get_ident(NULL); +int main(int argc, char *argv[]) +{ + struct mddev_ident *array_list = conf_get_ident(NULL); + struct context c = { .freeze_reshape = 1 }; if (!array_list) { - fprintf(stderr, Name ": No arrays found in config file\n"); + pr_err("No arrays found in config file\n"); rv = 1; } else for (; array_list; array_list = array_list->next) { @@ -110,9 +84,7 @@ int main(int argc, char *argv[]) { if (mdfd >= 0) close(mdfd); rv |= Assemble(array_list->st, array_list->devname, - array_list, NULL, NULL, - readonly, runstop, NULL, NULL, 0, - verbose, force); + array_list, NULL, &c); } return rv; }