summaryrefslogtreecommitdiffstats
path: root/mdadm.h
diff options
context:
space:
mode:
authorMateusz Kusiak <mateusz.kusiak@intel.com>2024-04-29 15:07:14 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-05-07 01:49:37 +0200
commit0acda7053df653022e46fa3b7caf1f4d4ba31a66 (patch)
tree7dc918ba2396735afa81b6f9df4490b9fc0df195 /mdadm.h
parentmdadm: pass struct context for external reshapes (diff)
downloadmdadm-0acda7053df653022e46fa3b7caf1f4d4ba31a66.tar.xz
mdadm-0acda7053df653022e46fa3b7caf1f4d4ba31a66.zip
mdadm: use struct context in reshape_super()
reshape_super() takes too many arguments. Change passing params in favor of single struct. Add devname pointer and change direction members to struct shape and use it for reshape_super(). Create reshape_array_size() and reshape_array_non_size() to handle reshape_super() calls. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/mdadm.h b/mdadm.h
index 0ade4beb..2ff3e463 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -594,6 +594,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 +672,9 @@ struct context {
};
struct shape {
+ char *dev;
int raiddisks;
+ int delta_disks;
int sparedisks;
int journaldisks;
int level;
@@ -682,6 +689,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,14 +1237,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 *dev, int direction,
- struct context *c);
+
+ 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,