summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/monitor.c b/monitor.c
index 6377cc4a..5bb25596 100644
--- a/monitor.c
+++ b/monitor.c
@@ -367,54 +367,11 @@ static void reconcile_failed(struct active_array *aa, struct mdinfo *failed)
}
}
-static int handle_remove_device(struct md_remove_device_cmd *cmd, struct active_array *aa)
-{
- struct active_array *a;
- struct mdinfo *victim;
- int rv;
-
- /* scan all arrays for the given device, if ->state_fd is closed (-1)
- * in all cases then mark the disk as removed in the metadata.
- * Otherwise reply that it is busy.
- */
-
- /* pass1 check that it is not in use anywhere */
- /* note: we are safe from re-adds as long as the device exists in the
- * container
- */
- for (a = aa; a; a = a->next) {
- if (!a->container)
- continue;
- victim = find_device(a, major(cmd->rdev), minor(cmd->rdev));
- if (!victim)
- continue;
- if (victim->state_fd > 0)
- return -EBUSY;
- }
-
- /* pass2 schedule and process removal per array */
- for (a = aa; a; a = a->next) {
- if (!a->container)
- continue;
- victim = find_device(a, major(cmd->rdev), minor(cmd->rdev));
- if (!victim)
- continue;
- victim->curr_state |= DS_REMOVE;
- rv = read_and_act(a);
- if (rv < 0)
- return rv;
- }
-
- return 0;
-}
-
static int handle_pipe(struct md_generic_cmd *cmd, struct active_array *aa)
{
switch (cmd->action) {
case md_action_ping_monitor:
return 0;
- case md_action_remove_device:
- return handle_remove_device((void *) cmd, aa);
}
return -1;