]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
Change 'size' argument to validate_geometry to be sectors, not K
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 8131b60a3bde1861c3962668fb1f722550ac550d..b0966e6f9f9fa9c2b310605d843160ac1ff0dbeb 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -315,12 +315,14 @@ struct map_ent {
        int     devnum;
        char    metadata[20];
        int     uuid[4];
+       int     bad;
        char    *path;
 };
 extern int map_update(struct map_ent **mpp, int devnum, char *metadata,
                      int uuid[4], char *path);
 extern struct map_ent *map_by_uuid(struct map_ent **map, int uuid[4]);
-struct map_ent *map_by_devnum(struct map_ent **map, int devnum);
+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 void map_read(struct map_ent **melp);
 extern int map_write(struct map_ent *mel);
 extern void map_delete(struct map_ent **mapp, int devnum);
@@ -501,7 +503,7 @@ extern struct superswitch {
        /* update the metadata to include new device, either at create or
         * when hot-adding a spare.
         */
-       void (*add_to_super)(struct supertype *st, mdu_disk_info_t *dinfo,
+       int (*add_to_super)(struct supertype *st, mdu_disk_info_t *dinfo,
                             int fd, char *devname);
 
        /* Write metadata to one device when fixing problems or adding
@@ -530,6 +532,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.
         */
        int (*validate_geometry)(struct supertype *st, int level, int layout,
                                 int raiddisks,
@@ -632,7 +635,6 @@ struct supertype {
                        *  external:/md0/12
                        */
        int devcnt;
-       char *device_name; /* e.g. /dev/md/whatever */
 
        struct mdinfo *devs;
 
@@ -644,6 +646,7 @@ extern struct supertype *dup_super(struct supertype *st);
 extern int get_dev_size(int fd, char *dname, unsigned long long *sizep);
 extern void get_one_disk(int mdfd, mdu_array_info_t *ainf,
                         mdu_disk_info_t *disk);
+void wait_for(char *dev);
 
 #if __GNUC__ < 3
 struct stat64;
@@ -758,6 +761,7 @@ extern int check_raid(int fd, char *name);
 
 extern int get_mdp_major(void);
 extern int dev_open(char *dev, int flags);
+extern int open_dev(int devnum);
 extern int open_dev_excl(int devnum);
 extern int is_standard(char *dev, int *nump);
 extern int same_dev(char *one, char *two);