]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
mdadm.man: added encouragement to shrink filesystem before array.
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index f1fe24f3c03184eec1ec3200545c89154c1d858a..f5367bfbb6e8e3d8962befbfb50bcaff5eef5ae4 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -68,28 +68,30 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
 #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
+/* MAP_DIR 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
+ * Currently /dev seems to be the only option on most distros.
+ */
+#ifndef MAP_DIR
+#define MAP_DIR "/dev/.mdadm"
+#endif /* MAP_DIR */
+/* MAP_FILE is what we name the map file we put in MAP_DIR, in case you
+ * want something other than the default of "map"
  */
-#ifndef ALT_RUN
-#define ALT_RUN "/lib/init/rw/mdadm"
-#endif /* ALT_RUN */
-#ifndef ALT_MAPFILE
-#define ALT_MAPFILE "map"
-#endif /* ALT_MAPFILE */
+#ifndef MAP_FILE
+#define MAP_FILE "map"
+#endif /* MAP_FILE */
+/* MDMON_DIR is where pid and socket files used for communicating
+ * with mdmon normally live.  It *should* be /var/run, but when
+ * mdmon is needed at early boot then it needs to write there prior
+ * to /var/run being mounted read/write, and it also then needs to
+ * persist beyond when /var/run is mounter read-only.  So, to be
+ * safe, the default is somewhere that is read/write early in the
+ * boot process and stays up as long as possible during shutdown.
+ */
+#ifndef MDMON_DIR
+#define MDMON_DIR "/dev/.mdadm/"
+#endif /* MDMON_DIR */
 
 #include       "md_u.h"
 #include       "md_p.h"
@@ -193,7 +195,7 @@ struct mdinfo {
        unsigned long           safe_mode_delay; /* ms delay to mark clean */
        int                     new_level, delta_disks, new_layout, new_chunk;
        int                     errors;
-       int                     cache_size; /* size of raid456 stripe cache*/
+       unsigned long           cache_size; /* size of raid456 stripe cache*/
        int                     mismatch_cnt;
        char                    text_version[50];
        void                    *update_private; /* for passing metadata-format
@@ -298,14 +300,14 @@ typedef struct mddev_ident_s {
        int     uuid[4];
        char    name[33];
 
-       unsigned int super_minor;
+       int super_minor;
 
        char    *devices;       /* comma separated list of device
                                 * names with wild cards
                                 */
        int     level;
-       unsigned int raid_disks;
-       unsigned int spare_disks;
+       int raid_disks;
+       int spare_disks;
        struct supertype *st;
        int     autof;          /* 1 for normal, 2 for partitioned */
        char    *spare_group;
@@ -356,7 +358,6 @@ struct mdstat_ent {
        int             resync; /* 1 if resync, 0 if recovery */
        int             devcnt;
        int             raid_disks;
-       int             chunk_size;
        char *          metadata_version;
        struct dev_member {
                char                    *name;
@@ -579,7 +580,11 @@ extern struct superswitch {
         * when hot-adding a spare.
         */
        int (*add_to_super)(struct supertype *st, mdu_disk_info_t *dinfo,
-                            int fd, char *devname);
+                           int fd, char *devname);
+       /* update the metadata to delete a device,
+        * when hot-removing.
+        */
+       int (*remove_from_super)(struct supertype *st, mdu_disk_info_t *dinfo);
 
        /* Write metadata to one device when fixing problems or adding
         * a new device.
@@ -890,6 +895,7 @@ extern char *fname_from_uuid(struct supertype *st,
 extern unsigned long calc_csum(void *super, int bytes);
 extern int enough(int level, int raid_disks, int layout, int clean,
                   char *avail, int avail_disks);
+extern int enough_fd(int fd);
 extern int ask(char *mesg);
 extern unsigned long long get_component_size(int fd);
 extern void remove_partitions(int fd);
@@ -934,7 +940,6 @@ int is_container_active(char *devname);
 extern int open_subarray(char *dev, struct supertype *st, int quiet);
 extern struct superswitch *version_to_superswitch(char *vers);
 
-extern char *pid_dir;
 extern int mdmon_running(int devnum);
 extern int mdmon_pid(int devnum);
 extern int check_env(char *name);