Help_manage[], Help_misc[], Help_monitor[], Help_config[];
/* for option that don't have short equivilents, we assign arbitrary
- * small numbers. '1' means an undecorated option, so we start at '2'.
- * (note we must stop before we get to 65 i.e. 'A')
+ * numbers later than any 'short' character option.
*/
enum special_options {
- AssumeClean = 2,
+ AssumeClean = 300,
BitmapChunk,
WriteBehind,
ReAdd,
NoDegraded,
Sparc22,
- BackupFile, /* 8 */
+ BackupFile,
HomeHost,
AutoHomeHost,
Symlinks,
Waitclean,
DetailPlatform,
KillSubarray,
- UpdateSubarray, /* 16 */
+ UpdateSubarray,
IncrementalPath,
- NoSharing
+ NoSharing,
+ HelpOptions,
+ Brief,
+ ManageOpt,
+ Add,
+ Remove,
+ Fail,
+ MiscOpt,
+ WaitOpt,
+ ConfigFile,
+ ChunkSize,
+ WriteMostly,
+ Layout,
+ Auto,
+ Force,
+ SuperMinor,
+ EMail,
+ ProgramOpt,
+ Increment,
+ Fork,
+ Bitmap,
+ RebuildMapOpt,
};
/* structures read from config file */
/* List of device names - wildcards expanded */
struct mddev_dev {
char *devname;
- char disposition; /* 'a' for add, 'r' for remove, 'f' for fail.
+ int disposition; /* 'a' for add, 'r' for remove, 'f' for fail.
* Not set for names read from .config
*/
char writemostly; /* 1 for 'set writemostly', 2 for 'clear writemostly' */
* added to validate changing size and new devices. If there are
* inter-device dependencies, it should record sufficient details
* so these can be validated.
- * Both 'size' and '*freesize' are in sectors. chunk is bytes.
+ * Both 'size' and '*freesize' are in sectors. chunk is KiB.
*/
int (*validate_geometry)(struct supertype *st, int level, int layout,
int raiddisks,
int verbose);
struct mdinfo *(*container_content)(struct supertype *st, char *subarray);
- /* Allow a metadata handler to override mdadm's default layouts */
- int (*default_layout)(int level); /* optional */
- /* query the supertype for default chunk size */
- int (*default_chunk)(struct supertype *st); /* optional */
+ /* query the supertype for default geometry */
+ void (*default_geometry)(struct supertype *st, int *level, int *layout, int *chunk); /* optional */
/* Permit subarray's to be deleted from inactive containers */
int (*kill_subarray)(struct supertype *st); /* optional */
/* Permit subarray's to be modified */
int (*update_subarray)(struct supertype *st, char *subarray,
char *update, struct mddev_ident *ident); /* optional */
+ /* Check if reshape is supported for this external format.
+ * st is obtained from super_by_fd() where st->subarray[0] is
+ * initialized to indicate if reshape is being performed at the
+ * container or subarray level
+ */
+ int (*reshape_super)(struct supertype *st, long long size, int level,
+ int layout, int chunksize, int raid_disks,
+ char *backup, char *dev, int verbose); /* optional */
+ int (*manage_reshape)(struct supertype *st, char *backup); /* optional */
/* for mdmon */
int (*open_new)(struct supertype *c, struct active_array *a,
extern struct supertype *dup_super(struct supertype *st);
extern int get_dev_size(int fd, char *dname, unsigned long long *sizep);
extern int must_be_container(int fd);
-extern int dev_size_from_id(unsigned id, unsigned long long *size);
+extern int dev_size_from_id(dev_t id, unsigned long long *size);
extern void get_one_disk(int mdfd, mdu_array_info_t *ainf,
mdu_disk_info_t *disk);
void wait_for(char *dev, int fd);
extern int add_disk(int mdfd, struct supertype *st,
struct mdinfo *sra, struct mdinfo *info);
+extern int remove_disk(int mdfd, struct supertype *st,
+ struct mdinfo *sra, struct mdinfo *info);
extern int set_array_info(int mdfd, struct supertype *st, struct mdinfo *info);
unsigned long long min_recovery_start(struct mdinfo *array);