summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>2010-11-22 20:58:06 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 20:58:06 +1100
commit950bc34477adcaa8788f09255d2fcfa19c052b0f (patch)
tree28d88468e6ffc917411b53a019c3db284d301605 /Incremental.c
parent157e6e24b9790940918597e8a07020ca56ce6011 (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 'Incremental.c')
-rw-r--r--Incremental.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Incremental.c b/Incremental.c
index b7bf0b4f..a2235530 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1351,17 +1351,23 @@ static int Incremental_container(struct supertype *st, char *devname,
* raid arrays, and if so first fail (if needed) and then remove the device.
*
* @devname - The device we want to remove
+ * @id_path - name as found in /dev/disk/by-path for this device
*
* Note: the device name must be a kernel name like "sda", so
* that we can find it in /proc/mdstat
*/
-int IncrementalRemove(char *devname, int verbose)
+int IncrementalRemove(char *devname, char *id_path, int verbose)
{
int mdfd;
int rv;
struct mdstat_ent *ent;
struct mddev_dev devlist;
+ if (!id_path)
+ dprintf(Name ": incremental removal without --path <id_path> "
+ "lacks the possibility to re-add new device in this "
+ "port\n");
+
if (strchr(devname, '/')) {
fprintf(stderr, Name ": incremental removal requires a "
"kernel device name, not a file: %s\n", devname);