#define DS_SPARE 8
#define DS_BLOCKED 16
#define DS_REMOVE 1024
+ #define DS_UNBLOCK 2048
int prev_state, curr_state, next_state;
};
#define GET_MISMATCH 32
#define GET_VERSION 64
#define GET_DISKS 128
+#define GET_DEGRADED 256
#define GET_DEVS 1024 /* gets role, major, minor */
#define GET_OFFSET 2048
extern int sysfs_set_array(struct mdinfo *sra,
struct mdinfo *info);
extern int sysfs_add_disk(struct mdinfo *sra, struct mdinfo *sd);
-extern int sysfs_disk_to_sg(int fd);
extern int sysfs_disk_to_scsi_id(int fd, __u32 *id);
extern int sysfs_unique_holder(int devnum, long rdev);
int (*validate_geometry)(struct supertype *st, int level, int layout,
int raiddisks,
int chunk, unsigned long long size,
- char *subdev, unsigned long long *freesize);
+ char *subdev, unsigned long long *freesize,
+ int verbose);
struct mdinfo *(*container_content)(struct supertype *st);
/* Tell the metadata handler the current state of the array.
* This covers whether it is known to be consistent (no pending writes)
- * when how far along a resync is known to have progressed
+ * and how far along a resync is known to have progressed
* (in a->resync_start).
* resync status is really irrelevant if the array is not consistent,
* but some metadata (DDF!) have a place to record the distinction.
+ * If 'consistent' is '2', then the array can mark it dirty if a
+ * resync/recovery/whatever is required, or leave it clean if not.
+ * Return value is 0 dirty (not consistent) and 1 if clean.
+ * it is only really important if consistent is passed in as '2'.
*/
- void (*set_array_state)(struct active_array *a, int consistent);
+ int (*set_array_state)(struct active_array *a, int consistent);
/* When the state of a device might have changed, we call set_disk to
* tell the metadata what the current state is.
extern int mdmon_running(int devnum);
extern int signal_mdmon(int devnum);
+extern int env_no_mdmon(void);
+extern int start_mdmon(int devnum);
extern char *devnum2devname(int num);
+extern int devname2devnum(char *name);
extern int fd2devnum(int fd);
static inline int dev2major(int d)
return (-1-d) << MdpMinorShift;
}
+static inline int ROUND_UP(int a, int base)
+{
+ return ((a+base-1)/base)*base;
+}
+
#define LEVEL_MULTIPATH (-4)
#define LEVEL_LINEAR (-1)
#define LEVEL_FAULTY (-5)