From 7a8ce8dbf73fc149c67b22e3b90f542f70944e93 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Tue, 19 May 2015 15:13:01 +0200 Subject: [PATCH] polldaemon: remove get_copy_vg and get_copy_lv wrappers These wrappers have been replaced by direct calls to vg_read() and find_lv() in previous commits. This commit should have no functional impact since all bits were already unreachable. --- lib/lvmpolld/polldaemon.h | 17 ----------------- tools/lvconvert.c | 6 ------ tools/lvpoll.c | 8 -------- tools/polldaemon.c | 26 -------------------------- tools/pvmove.c | 2 -- 5 files changed, 59 deletions(-) diff --git a/lib/lvmpolld/polldaemon.h b/lib/lvmpolld/polldaemon.h index 2c7ce4bbb..36b654fa3 100644 --- a/lib/lvmpolld/polldaemon.h +++ b/lib/lvmpolld/polldaemon.h @@ -29,15 +29,6 @@ struct daemon_parms; struct poll_functions { const char *(*get_copy_name_from_lv) (const struct logical_volume *lv); - struct volume_group *(*get_copy_vg) (struct cmd_context *cmd, - const char *name, - const char *uuid, - uint32_t flags); - struct logical_volume *(*get_copy_lv) (struct cmd_context *cmd, - struct volume_group *vg, - const char *name, - const char *uuid, - uint64_t lv_type); progress_t (*poll_progress)(struct cmd_context *cmd, struct logical_volume *lv, const char *name, @@ -79,14 +70,6 @@ progress_t poll_mirror_progress(struct cmd_context *cmd, struct logical_volume *lv, const char *name, struct daemon_parms *parms); -struct volume_group *poll_get_copy_vg(struct cmd_context *cmd, const char *name, - const char *uuid, uint32_t flags); - -struct logical_volume *poll_get_copy_lv(struct cmd_context *cmd, - struct volume_group *vg, - const char *name, const char *uuid, - uint64_t lv_type); - int wait_for_single_lv(struct cmd_context *cmd, struct poll_operation_id *id, struct daemon_parms *parms); diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 7267c2fbe..9192d04ff 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -700,22 +700,16 @@ static int _read_params(struct cmd_context *cmd, int argc, char **argv, } static struct poll_functions _lvconvert_mirror_fns = { - .get_copy_vg = poll_get_copy_vg, - .get_copy_lv = poll_get_copy_lv, .poll_progress = poll_mirror_progress, .finish_copy = lvconvert_mirror_finish, }; static struct poll_functions _lvconvert_merge_fns = { - .get_copy_vg = poll_get_copy_vg, - .get_copy_lv = poll_get_copy_lv, .poll_progress = poll_merge_progress, .finish_copy = lvconvert_merge_finish, }; static struct poll_functions _lvconvert_thin_merge_fns = { - .get_copy_vg = poll_get_copy_vg, - .get_copy_lv = poll_get_copy_lv, .poll_progress = poll_thin_merge_progress, .finish_copy = lvconvert_merge_finish, }; diff --git a/tools/lvpoll.c b/tools/lvpoll.c index 0ed2d4584..178392e7f 100644 --- a/tools/lvpoll.c +++ b/tools/lvpoll.c @@ -19,30 +19,22 @@ #include "polling_ops.h" static struct poll_functions _pvmove_fns = { - .get_copy_lv = poll_get_copy_lv, - .get_copy_vg = poll_get_copy_vg, .poll_progress = poll_mirror_progress, .update_metadata = pvmove_update_metadata, .finish_copy = pvmove_finish }; static struct poll_functions _convert_fns = { - .get_copy_lv = poll_get_copy_lv, - .get_copy_vg = poll_get_copy_vg, .poll_progress = poll_mirror_progress, .finish_copy = lvconvert_mirror_finish }; static struct poll_functions _merge_fns = { - .get_copy_lv = poll_get_copy_lv, - .get_copy_vg = poll_get_copy_vg, .poll_progress = poll_merge_progress, .finish_copy = lvconvert_merge_finish }; static struct poll_functions _thin_merge_fns = { - .get_copy_lv = poll_get_copy_lv, - .get_copy_vg = poll_get_copy_vg, .poll_progress = poll_thin_merge_progress, .finish_copy = lvconvert_merge_finish }; diff --git a/tools/polldaemon.c b/tools/polldaemon.c index d5daa6282..9f4fc94cc 100644 --- a/tools/polldaemon.c +++ b/tools/polldaemon.c @@ -54,32 +54,6 @@ progress_t poll_mirror_progress(struct cmd_context *cmd, return PROGRESS_FINISHED_SEGMENT; } -struct volume_group *poll_get_copy_vg(struct cmd_context *cmd, - const char *name, - const char *uuid __attribute__((unused)), - uint32_t flags) -{ - if (name && !strchr(name, '/')) - return vg_read(cmd, name, NULL, flags); - - /* 'name' is the full LV name; must extract_vgname() */ - return vg_read(cmd, extract_vgname(cmd, name), NULL, flags); -} - -struct logical_volume *poll_get_copy_lv(struct cmd_context *cmd __attribute__((unused)), - struct volume_group *vg, - const char *name, - const char *uuid, - uint64_t lv_type) -{ - struct logical_volume *lv = find_lv(vg, name); - - if (!lv || (uuid && strcmp(uuid, (char *)&lv->lvid)) || (lv_type && !(lv->status & lv_type))) - return NULL; - - return lv; -} - static int _check_lv_status(struct cmd_context *cmd, struct volume_group *vg, struct logical_volume *lv, diff --git a/tools/pvmove.c b/tools/pvmove.c index dc36955b4..d5b246f65 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -744,8 +744,6 @@ static int _read_poll_id_from_pvname(struct cmd_context *cmd, const char *pv_nam static struct poll_functions _pvmove_fns = { .get_copy_name_from_lv = get_pvmove_pvname_from_lv_mirr, - .get_copy_vg = poll_get_copy_vg, - .get_copy_lv = poll_get_copy_lv, .poll_progress = poll_mirror_progress, .update_metadata = pvmove_update_metadata, .finish_copy = pvmove_finish,