summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2015-05-19 15:08:50 +0200
committerOndrej Kozina <okozina@redhat.com>2015-05-19 20:56:07 +0200
commit6fba37777c8a0931adf1164ff914aa494d8bcee8 (patch)
tree8f10473ad40b52b458e1cc921a0fa756a16226de
parent08114840caf0a31d76b8870ec96594dd715baff0 (diff)
downloadlvm2-6fba37777c8a0931adf1164ff914aa494d8bcee8.tar.gz
polldaemon.c: call find_lv directly
-rw-r--r--tools/polldaemon.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index 2cb56fa7c..d5daa6282 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -179,7 +179,12 @@ int wait_for_single_lv(struct cmd_context *cmd, struct poll_operation_id *id,
return 0;
}
- lv = parms->poll_fns->get_copy_lv(cmd, vg, id->lv_name, id->uuid, parms->lv_type);
+ lv = find_lv(vg, id->lv_name);
+
+ if (lv && id->uuid && strcmp(id->uuid, (char *)&lv->lvid))
+ lv = NULL;
+ if (lv && parms->lv_type && !(lv->status & parms->lv_type))
+ lv = NULL;
if (!lv && parms->lv_type == PVMOVE) {
log_print_unless_silent("%s: No pvmove in progress - already finished or aborted.",
@@ -339,8 +344,13 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
/* perform the poll operation on LVs collected in previous cycle */
dm_list_iterate_items(idl, &idls) {
- lv = parms->poll_fns->get_copy_lv(cmd, vg, idl->id->lv_name, idl->id->uuid, parms->lv_type);
- if (lv && _check_lv_status(cmd, vg, lv, idl->id->display_name, parms, &finished) && !finished)
+ if (!(lv = find_lv(vg, idl->id->lv_name)))
+ continue;
+ if (idl->id->uuid && strcmp(idl->id->uuid, (char *)&lv->lvid))
+ continue;
+ if (parms->lv_type && !(lv->status & parms->lv_type))
+ continue;
+ if (_check_lv_status(cmd, vg, lv, idl->id->display_name, parms, &finished) && !finished)
parms->outstanding_count++;
}
@@ -386,7 +396,13 @@ static int report_progress(struct cmd_context *cmd, struct poll_operation_id *id
return 0;
}
- lv = parms->poll_fns->get_copy_lv(cmd, vg, id->lv_name, id->uuid, parms->lv_type);
+ lv = find_lv(vg, id->lv_name);
+
+ if (lv && id->uuid && strcmp(id->uuid, (char *)&lv->lvid))
+ lv = NULL;
+ if (lv && parms->lv_type && !(lv->status & parms->lv_type))
+ lv = NULL;
+
if (!lv && parms->lv_type == PVMOVE) {
log_print_unless_silent("%s: No pvmove in progress - already finished or aborted.",
id->display_name);