#define DEFAULT_BITMAP_DELAY 5
#define DEFAULT_MAX_WRITE_BEHIND 256
+/* VAR_RUN is where pid and socket files used for communicating
+ * with mdmon normally live. It should be /var/run, but if
+ * it is too hard to remount /var/run as read-only rather than
+ * unmounting it at shutdown time, then it should be
+ * redefined to some place that comfortably persists until
+ * final shutdown, possibly in /dev if that is a tmpfs.
+ * Note: VAR_RUN does not need to be writable at shutdown,
+ * only during boot when "mdmon --takeover" is run.
+ */
+#ifndef VAR_RUN
#define VAR_RUN "/var/run/mdadm"
+#endif /* VAR_RUN */
/* ALT_RUN should be somewhere that persists across the pivotroot
* from early boot to late boot.
* If you don't have /lib/init/rw you might want to use /dev/.something
#ifndef ALT_RUN
#define ALT_RUN "/lib/init/rw/mdadm"
#endif /* ALT_RUN */
+#ifndef ALT_MAPFILE
+#define ALT_MAPFILE "map"
+#endif /* ALT_MAPFILE */
#include "md_u.h"
#include "md_p.h"
int container_member; /* for assembling external-metatdata arrays
* This is to be used internally by metadata
* handler only */
-
+ int container_enough; /* flag external handlers can set to
+ * indicate that subarrays have not enough (-1),
+ * enough to start (0), or all expected disks (1) */
char sys_name[20];
struct mdinfo *devs;
struct mdinfo *next;
char *member; /* subarray within a container */
struct mddev_ident_s *next;
+ union {
+ /* fields needed by different users of this structure */
+ int assembled; /* set when assembly succeeds */
+ };
} *mddev_ident_t;
/* List of device names - wildcards expanded */
};
extern int map_update(struct map_ent **mpp, int devnum, char *metadata,
int uuid[4], char *path);
+extern void map_remove(struct map_ent **map, int devnum);
extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]);
extern struct map_ent *map_by_devnum(struct map_ent **map, int devnum);
extern struct map_ent *map_by_name(struct map_ent **map, char *name);
extern mddev_ident_t conf_get_ident(char *dev);
extern mddev_dev_t conf_get_devs(void);
extern int conf_test_dev(char *devname);
-extern int conf_test_metadata(const char *version);
+extern int conf_test_metadata(const char *version, int is_homehost);
extern struct createinfo *conf_get_create_info(void);
extern void set_conffile(char *file);
extern char *conf_get_mailaddr(void);
extern int ask(char *mesg);
extern unsigned long long get_component_size(int fd);
extern void remove_partitions(int fd);
+extern int test_partition(int fd);
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);
char *chosen);
/* values for 'trustworthy' */
#define LOCAL 1
+#define LOCAL_ANY 10
#define FOREIGN 2
#define METADATA 3
extern int open_mddev(char *dev, int report_errors);