]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Monitor: devid should be dev_t
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 8e220de939cc69693d36a6cd327dba63993e0de2..48a202d6d97877451d63e827c586451b7e6964d7 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -269,17 +269,16 @@ extern char Version[], Usage[], Help[], OptionHelp[],
        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,
@@ -287,9 +286,30 @@ enum special_options {
        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 */
@@ -341,7 +361,7 @@ struct mddev_ident {
 /* 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' */
@@ -626,7 +646,7 @@ extern struct superswitch {
         * 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,
@@ -635,15 +655,22 @@ extern struct superswitch {
                                 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,
@@ -767,7 +794,7 @@ static inline struct supertype *guess_super(int fd) {
 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);
@@ -1041,6 +1068,8 @@ extern int assemble_container_content(struct supertype *st, int mdfd,
 
 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);