mdassemble: include mapfile support.
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>
This commit is contained in:
parent
7d55dca2cc
commit
53a087b105
2
Makefile
2
Makefile
|
@ -149,7 +149,7 @@ STATICOBJS = pwgr.o
|
||||||
ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c \
|
ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c \
|
||||||
maps.c lib.c xmalloc.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 \
|
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_AUTO_SRCS := mdopen.c
|
||||||
ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE
|
ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE
|
||||||
ifdef MDASSEMBLE_AUTO
|
ifdef MDASSEMBLE_AUTO
|
||||||
|
|
10
mdadm.h
10
mdadm.h
|
@ -501,18 +501,8 @@ extern int map_update(struct map_ent **mpp, char *devnm, char *metadata,
|
||||||
int uuid[4], char *path);
|
int uuid[4], char *path);
|
||||||
extern void map_remove(struct map_ent **map, char *devnm);
|
extern void map_remove(struct map_ent **map, char *devnm);
|
||||||
extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]);
|
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 struct map_ent *map_by_devnm(struct map_ent **map, char *devnm);
|
||||||
extern void map_free(struct map_ent *map);
|
extern void map_free(struct map_ent *map);
|
||||||
#endif
|
|
||||||
extern struct map_ent *map_by_name(struct map_ent **map, char *name);
|
extern struct map_ent *map_by_name(struct map_ent **map, char *name);
|
||||||
extern void map_read(struct map_ent **melp);
|
extern void map_read(struct map_ent **melp);
|
||||||
extern int map_write(struct map_ent *mel);
|
extern int map_write(struct map_ent *mel);
|
||||||
|
|
12
mdassemble.c
12
mdassemble.c
|
@ -50,18 +50,6 @@ int create_mddev(char *dev, char *name, int autof/*unused*/, int trustworthy,
|
||||||
return open_mddev(dev, 0);
|
return open_mddev(dev, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#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 rv;
|
||||||
int mdfd = -1;
|
int mdfd = -1;
|
||||||
|
|
Loading…
Reference in New Issue