]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdassemble: include mapfile support.
authorNeilBrown <neilb@suse.com>
Mon, 3 Aug 2015 01:54:16 +0000 (11:54 +1000)
committerNeilBrown <neilb@suse.com>
Mon, 3 Aug 2015 05:42:31 +0000 (15:42 +1000)
This does make mdassemble a bit bigger, but it also means
it actually works properly with named arrays.

Ref: https://bbs.archlinux.org/viewtopic.php?id=198196
Signed-off-by: NeilBrown <neilb@suse.com>
Makefile
mdadm.h
mdassemble.c

index a7d8c5c1b7fa9df513beb80387e70f06b6c1e1b6..d82e30f8f18945124445cf243a7759e98400f923 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -145,7 +145,7 @@ STATICOBJS = pwgr.o
 ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c \
        maps.c lib.c xmalloc.c \
        super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c mdstat.c \
-       platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c
+       platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c mapfile.c
 ASSEMBLE_AUTO_SRCS := mdopen.c
 ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE
 ifdef MDASSEMBLE_AUTO
diff --git a/mdadm.h b/mdadm.h
index 9df43d48a420b51e1ba7f0fa029d9cad177d24e5..b5976582f40711423a23ce508d554a36611a465c 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -490,18 +490,8 @@ extern int map_update(struct map_ent **mpp, char *devnm, char *metadata,
                      int uuid[4], char *path);
 extern void map_remove(struct map_ent **map, char *devnm);
 extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]);
-#ifdef MDASSEMBLE
-static inline struct map_ent *map_by_devnm(struct map_ent **map, char *name)
-{
-       return NULL;
-}
-static inline void map_free(struct map_ent *map)
-{
-}
-#else
 extern struct map_ent *map_by_devnm(struct map_ent **map, char *devnm);
 extern void map_free(struct map_ent *map);
-#endif
 extern struct map_ent *map_by_name(struct map_ent **map, char *name);
 extern void map_read(struct map_ent **melp);
 extern int map_write(struct map_ent *mel);
index 667b2474ad6e947335f5333b6914f297a7e87d7d..78d363a328c7e7449cc3b23f91534ee1a88ea5ca 100644 (file)
@@ -50,18 +50,6 @@ 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, char *devnm, char *metadata,
-              int *uuid, char *path)
-{
-       return 0;
-}
-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;