void (*sync_metadata)(struct supertype *st);
void (*process_update)(struct supertype *st,
struct metadata_update *update);
+ void (*prepare_update)(struct supertype *st,
+ struct metadata_update *update);
/* activate_spare will check if the array is degraded and, if it
* is, try to find some spare space in the container.
extern struct superswitch super_imsm;
+struct metadata_update {
+ int len;
+ char *buf;
+ void *space; /* allocated space that monitor will use */
+ struct metadata_update *next;
+};
+
/* A supertype holds a particular collection of metadata.
* It identifies the metadata type by the superswitch, and the particular
* sub-version of that metadata type.
void *sb;
void *info;
+ struct metadata_update *updates;
+ struct metadata_update **update_tail;
+
/* extra stuff used by mdmon */
struct active_array *arrays;
int sock; /* listen to external programs */
extern void remove_partitions(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);
+extern void append_metadata_update(struct supertype *st, void *buf, int len);
extern char *human_size(long long bytes);