diff options
author | Alexey Obitotskiy <aleksey.obitotskiy@intel.com> | 2017-05-09 12:25:46 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-05-09 20:18:36 +0200 |
commit | fbfdcb06dc5b1dcb227b0394f174faa2df734700 (patch) | |
tree | f7c3a01306d65df5eed6b797356704e37824ae94 /util.c | |
parent | imsm: don't allow disks with different sector size in one array (diff) | |
download | mdadm-fbfdcb06dc5b1dcb227b0394f174faa2df734700.tar.xz mdadm-fbfdcb06dc5b1dcb227b0394f174faa2df734700.zip |
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 'util.c')
-rw-r--r-- | util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2107,7 +2107,7 @@ int experimental(void) * if spare_group given add it to domains of each spare * metadata allows to test domains using metadata of destination array */ 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) @@ -2131,9 +2131,9 @@ struct mdinfo *container_choose_spares(struct supertype *st, unsigned long long dev_size; dev_t dev = makedev(d->disk.major,d->disk.minor); - if (!min_size || + if (!criteria->min_size || (dev_size_from_id(dev, &dev_size) && - dev_size >= min_size)) + dev_size >= criteria->min_size)) found = 1; /* check if domain matches */ if (found && domlist) { |