summaryrefslogtreecommitdiff
path: root/mdadm.h
diff options
context:
space:
mode:
authorAlexey Obitotskiy <aleksey.obitotskiy@intel.com>2017-05-09 12:25:46 +0200
committerJes Sorensen <jsorensen@fb.com>2017-05-09 14:18:36 -0400
commitfbfdcb06dc5b1dcb227b0394f174faa2df734700 (patch)
treef7c3a01306d65df5eed6b797356704e37824ae94 /mdadm.h
parentf2cc4f7d829e1b849e78bdf6c38b7bd6e234c600 (diff)
downloadmdadm-fbfdcb06dc5b1dcb227b0394f174faa2df734700.tar.gz
Allow more spare selection criteria
Disks can be moved across containers in order to be used as a spare drive for reubild. At the moment the only requirement checked for such disk is its size (if it matches donor expectations). In order to introduce more criteria rename corresponding superswitch method to more generic name and move function parameter to a structure. This change is a big edit but it doesn't introduce any changes in code logic, it just updates function naming and parameters. Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com> Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r--mdadm.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/mdadm.h b/mdadm.h
index a92feb2..8da7fd3 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -361,6 +361,10 @@ struct createinfo {
struct supertype *supertype;
};
+struct spare_criteria {
+ unsigned long long min_size;
+};
+
enum mode {
ASSEMBLE=1,
BUILD,
@@ -940,11 +944,13 @@ extern struct superswitch {
*/
__u64 (*avail_size)(struct supertype *st, __u64 size,
unsigned long long data_offset);
- /* This is similar to 'avail_size' in purpose, but is used for
- * containers for which there is no 'component size' to compare.
- * This reports that whole-device size which is a minimum
+ /*
+ * Return spare criteria for array:
+ * - minimum disk size can be used in array;
+ * Return values: 0 - for success and -EINVAL on error.
*/
- unsigned long long (*min_acceptable_spare_size)(struct supertype *st);
+ int (*get_spare_criteria)(struct supertype *st,
+ struct spare_criteria *sc);
/* Find somewhere to put a bitmap - possibly auto-size it - and
* update the metadata to record this. The array may be newly
* created, in which case data_size may be updated, or it might
@@ -1507,7 +1513,7 @@ extern int assemble_container_content(struct supertype *st, int mdfd,
#define INCR_ALREADY 4
#define INCR_YES 8
extern struct mdinfo *container_choose_spares(struct supertype *st,
- unsigned long long min_size,
+ struct spare_criteria *criteria,
struct domainlist *domlist,
char *spare_group,
const char *metadata, int get_one);