summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-25 06:14:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-25 06:14:19 +0000
commit50f2ad8e92ef06e4dee6d7070049a96231d3a8ee (patch)
treeb7cda9c5caad5948899bf7d6551262d9d7d86d09 /mdadm.h
parentAdding upstream version 4.3+20240412. (diff)
downloadmdadm-50f2ad8e92ef06e4dee6d7070049a96231d3a8ee.tar.xz
mdadm-50f2ad8e92ef06e4dee6d7070049a96231d3a8ee.zip
Adding upstream version 4.3+20240723.upstream/4.3+20240723
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h44
1 files changed, 27 insertions, 17 deletions
diff --git a/mdadm.h b/mdadm.h
index 2640b39..2700915 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -223,6 +223,14 @@ struct dlm_lksb {
struct __una_u16 { __u16 x; } __attribute__ ((packed));
struct __una_u32 { __u32 x; } __attribute__ ((packed));
+/*
+ * Ensure GNU basename behavior on GLIBC less systems.
+ */
+#ifndef __GLIBC__
+#define basename(path) \
+ (strrchr((path), '/') ? strrchr((path),'/') + 1 : (path))
+#endif
+
static inline __u16 __get_unaligned16(const void *p)
{
const struct __una_u16 *ptr = (const struct __una_u16 *)p;
@@ -535,7 +543,8 @@ enum special_options {
};
enum update_opt {
- UOPT_NAME = 1,
+ UOPT_UNDEFINED = 0,
+ UOPT_NAME,
UOPT_PPL,
UOPT_NO_PPL,
UOPT_BITMAP,
@@ -575,7 +584,6 @@ enum update_opt {
UOPT_SPEC_FAILFAST,
UOPT_SPEC_NOFAILFAST,
UOPT_SPEC_REVERT_RESHAPE_NOBACKUP,
- UOPT_UNDEFINED
};
extern void fprint_update_options(FILE *outf, enum update_opt update_mode);
@@ -594,6 +602,11 @@ enum flag_mode {
FlagDefault, FlagSet, FlagClear,
};
+typedef enum {
+ ROLLBACK_METADATA_CHANGES,
+ APPLY_METADATA_CHANGES
+} change_dir_t;
+
/* structures read from config file */
/* List of mddevice names and identifiers
* Identifiers can be:
@@ -667,7 +680,9 @@ struct context {
};
struct shape {
+ char *dev;
int raiddisks;
+ int delta_disks;
int sparedisks;
int journaldisks;
int level;
@@ -682,6 +697,7 @@ struct shape {
unsigned long long size;
unsigned long long data_offset;
int consistency_policy;
+ change_dir_t direction;
};
/* List of device names - wildcards expanded */
@@ -1229,15 +1245,8 @@ extern struct superswitch {
* initialized to indicate if reshape is being performed at the
* container or subarray level
*/
-#define APPLY_METADATA_CHANGES 1
-#define ROLLBACK_METADATA_CHANGES 0
-
- int (*reshape_super)(struct supertype *st,
- unsigned long long size, int level,
- int layout, int chunksize, int raid_disks,
- int delta_disks, char *backup, char *dev,
- int direction,
- int verbose); /* optional */
+
+ int (*reshape_super)(struct supertype *st, struct shape *shape, struct context *c);
int (*manage_reshape)( /* optional */
int afd, struct mdinfo *sra, struct reshape *reshape,
struct supertype *st, unsigned long blocks,
@@ -1541,8 +1550,7 @@ extern int Grow_reshape(char *devname, int fd,
extern int Grow_restart(struct supertype *st, struct mdinfo *info,
int *fdlist, int cnt, char *backup_file, int verbose);
extern int Grow_continue(int mdfd, struct supertype *st,
- struct mdinfo *info, char *backup_file,
- int forked, int freeze_reshape);
+ struct mdinfo *info, int forked, struct context *c);
extern int Grow_consistency_policy(char *devname, int fd,
struct context *c, struct shape *s);
@@ -1552,8 +1560,7 @@ extern int restore_backup(struct supertype *st,
int spares,
char **backup_filep,
int verbose);
-extern int Grow_continue_command(char *devname, int fd,
- char *backup_file, int verbose);
+extern int Grow_continue_command(char *devname, int fd, struct context *c);
extern int Assemble(struct supertype *st, char *mddev,
struct mddev_ident *ident,
@@ -1769,8 +1776,11 @@ extern int is_subarray_active(char *subarray, char *devname);
extern int open_subarray(char *dev, char *subarray, struct supertype *st, int quiet);
extern struct superswitch *version_to_superswitch(char *vers);
-extern int mdmon_running(char *devnm);
-extern int mdmon_pid(char *devnm);
+extern mdadm_status_t wait_for_mdmon_control_socket(const char *container_devnm);
+extern int mdmon_running(const char *devnm);
+extern int mdmon_pid(const char *devnm);
+extern mdadm_status_t wait_for_mdmon(const char *devnm);
+
extern int check_env(char *name);
extern __u32 random32(void);
extern void random_uuid(__u8 *buf);