diff options
author | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2010-11-22 20:58:06 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-11-22 20:58:06 +1100 |
commit | 950bc34477adcaa8788f09255d2fcfa19c052b0f (patch) | |
tree | 28d88468e6ffc917411b53a019c3db284d301605 /mdadm.c | |
parent | 157e6e24b9790940918597e8a07020ca56ce6011 (diff) |
added --path <path_id> to give the information on the 'path-id' of removed device
<path-id> allows to identify the port to which given device is plugged
in. In case of hot-removal, udev can pass this information for future
use (eg. write this name as 'cookie' allowing to detect the fact of
reinserting device to the same port).
--path <path-id> parameter has been added to device removal handle
(and char *path has been added to IncrementalRemove() to pass this
value) in order to pass path-id to this handler.
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -104,6 +104,7 @@ int main(int argc, char *argv[]) int rebuild_map = 0; int auto_update_home = 0; char *subarray = NULL; + char *remove_path = NULL; int print_help = 0; FILE *outf; @@ -943,6 +944,9 @@ int main(int argc, char *argv[]) case O(INCREMENTAL, 'r'): rebuild_map = 1; continue; + case O(INCREMENTAL, IncrementalPath): + remove_path = optarg; + continue; } /* We have now processed all the valid options. Anything else is * an error @@ -1586,12 +1590,13 @@ int main(int argc, char *argv[]) rv = 1; break; } - if (devmode == 'f') { - rv = IncrementalRemove(devlist->devname, verbose-quiet); - break; - } - rv = Incremental(devlist->devname, verbose-quiet, runstop, - ss, homehost, require_homehost, autof); + if (devmode == 'f') + rv = IncrementalRemove(devlist->devname, remove_path, + verbose-quiet); + else + rv = Incremental(devlist->devname, verbose-quiet, + runstop, ss, homehost, + require_homehost, autof); break; case AUTODETECT: autodetect(); |