Just drop "mirror" or "mirr" part of names in polldaemon. The polldaemon will be used also for polling snapshot merging, so naming the arguments with "mirror" is misleading. This patch does nothing but chaning variable and function names. Signed-off-by: Mikulas Patocka --- tools/polldaemon.c | 41 ++++++++++++++++++++--------------------- tools/polldaemon.h | 6 +++--- 2 files changed, 23 insertions(+), 24 deletions(-) Index: LVM2.2.02.39/tools/polldaemon.c =================================================================== --- LVM2.2.02.39.orig/tools/polldaemon.c 2008-07-11 22:26:44.000000000 +0200 +++ LVM2.2.02.39/tools/polldaemon.c 2008-07-11 22:31:10.000000000 +0200 @@ -62,11 +62,11 @@ static int _become_daemon(struct cmd_con return 1; } -static int _check_mirror_status(struct cmd_context *cmd, - struct volume_group *vg, - struct logical_volume *lv_mirr, - const char *name, struct daemon_parms *parms, - int *finished) +static int _check_lv_status(struct cmd_context *cmd, + struct volume_group *vg, + struct logical_volume *lv, + const char *name, struct daemon_parms *parms, + int *finished) { struct list *lvs_changed; float segment_percent = 0.0, overall_percent = 0.0; @@ -77,22 +77,22 @@ static int _check_mirror_status(struct c *finished = 1; if (parms->aborting) { - if (!(lvs_changed = lvs_using_lv(cmd, vg, lv_mirr))) { + if (!(lvs_changed = lvs_using_lv(cmd, vg, lv))) { log_error("Failed to generate list of copied LVs: " "can't abort."); return 0; } - parms->poll_fns->finish_copy(cmd, vg, lv_mirr, lvs_changed); + parms->poll_fns->finish_copy(cmd, vg, lv, lvs_changed); return 0; } - if (!(status = lv_mirror_percent(cmd, lv_mirr, !parms->interval, + if (!(status = lv_mirror_percent(cmd, lv, !parms->interval, &segment_percent, &event_nr))) { log_error("ABORTING: Mirror percentage check failed."); return 0; } - overall_status = copy_percent(lv_mirr, &overall_percent); + overall_status = copy_percent(lv, &overall_percent); if (parms->progress_display) log_print("%s: %s: %.1f%%", name, parms->progress_title, overall_percent); @@ -106,21 +106,20 @@ static int _check_mirror_status(struct c return 1; } - if (!(lvs_changed = lvs_using_lv(cmd, vg, lv_mirr))) { + if (!(lvs_changed = lvs_using_lv(cmd, vg, lv))) { log_error("ABORTING: Failed to generate list of copied LVs"); return 0; } /* Finished? Or progress to next segment? */ if (overall_status == TARGET_STATUS_FINISHED) { - if (!parms->poll_fns->finish_copy(cmd, vg, lv_mirr, - lvs_changed)) + if (!parms->poll_fns->finish_copy(cmd, vg, lv, lvs_changed)) return 0; } else { - if (!parms->poll_fns->update_metadata(cmd, vg, lv_mirr, + if (!parms->poll_fns->update_metadata(cmd, vg, lv, lvs_changed, 0)) { log_error("ABORTING: Segment progression failed."); - parms->poll_fns->finish_copy(cmd, vg, lv_mirr, + parms->poll_fns->finish_copy(cmd, vg, lv, lvs_changed); return 0; } @@ -130,11 +129,11 @@ static int _check_mirror_status(struct c return 1; } -static int _wait_for_single_mirror(struct cmd_context *cmd, const char *name, - struct daemon_parms *parms) +static int _wait_for_single_lv(struct cmd_context *cmd, const char *name, + struct daemon_parms *parms) { struct volume_group *vg; - struct logical_volume *lv_mirr; + struct logical_volume *lv; int finished = 0; /* Poll for mirror completion */ @@ -154,16 +153,16 @@ static int _wait_for_single_mirror(struc return 0; } - if (!(lv_mirr = parms->poll_fns->get_copy_lv(cmd, vg, name, - parms->lv_type))) { + if (!(lv = parms->poll_fns->get_copy_lv(cmd, vg, name, + parms->lv_type))) { log_error("ABORTING: Can't find mirror LV in %s for %s", vg->name, name); unlock_vg(cmd, vg->name); return 0; } - if (!_check_mirror_status(cmd, vg, lv_mirr, name, parms, - &finished)) { + if (!_check_lv_status(cmd, vg, lv, name, parms, + &finished)) { unlock_vg(cmd, vg->name); return 0; } Index: LVM2.2.02.39/tools/polldaemon.h =================================================================== --- LVM2.2.02.39.orig/tools/polldaemon.h 2008-07-09 15:34:53.000000000 +0200 +++ LVM2.2.02.39/tools/polldaemon.h 2008-07-11 22:31:10.000000000 +0200 @@ -19,7 +19,7 @@ #include "metadata-exported.h" struct poll_functions { - const char *(*get_copy_name_from_lv) (struct logical_volume *lv_mirr); + const char *(*get_copy_name_from_lv) (struct logical_volume *lv); struct volume_group *(*get_copy_vg) (struct cmd_context *cmd, const char *name); struct logical_volume *(*get_copy_lv) (struct cmd_context *cmd, @@ -28,11 +28,11 @@ struct poll_functions { uint32_t lv_type); int (*update_metadata) (struct cmd_context *cmd, struct volume_group *vg, - struct logical_volume *lv_mirr, + struct logical_volume *lv, struct list *lvs_changed, unsigned flags); int (*finish_copy) (struct cmd_context *cmd, struct volume_group *vg, - struct logical_volume *lv_mirr, + struct logical_volume *lv, struct list *lvs_changed); };