mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
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.
This commit is contained in:
parent
6fba37777c
commit
7a8ce8dbf7
@ -29,15 +29,6 @@ struct daemon_parms;
|
|||||||
|
|
||||||
struct poll_functions {
|
struct poll_functions {
|
||||||
const char *(*get_copy_name_from_lv) (const struct logical_volume *lv);
|
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,
|
progress_t (*poll_progress)(struct cmd_context *cmd,
|
||||||
struct logical_volume *lv,
|
struct logical_volume *lv,
|
||||||
const char *name,
|
const char *name,
|
||||||
@ -79,14 +70,6 @@ progress_t poll_mirror_progress(struct cmd_context *cmd,
|
|||||||
struct logical_volume *lv, const char *name,
|
struct logical_volume *lv, const char *name,
|
||||||
struct daemon_parms *parms);
|
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,
|
int wait_for_single_lv(struct cmd_context *cmd, struct poll_operation_id *id,
|
||||||
struct daemon_parms *parms);
|
struct daemon_parms *parms);
|
||||||
|
|
||||||
|
@ -700,22 +700,16 @@ static int _read_params(struct cmd_context *cmd, int argc, char **argv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct poll_functions _lvconvert_mirror_fns = {
|
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,
|
.poll_progress = poll_mirror_progress,
|
||||||
.finish_copy = lvconvert_mirror_finish,
|
.finish_copy = lvconvert_mirror_finish,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct poll_functions _lvconvert_merge_fns = {
|
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,
|
.poll_progress = poll_merge_progress,
|
||||||
.finish_copy = lvconvert_merge_finish,
|
.finish_copy = lvconvert_merge_finish,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct poll_functions _lvconvert_thin_merge_fns = {
|
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,
|
.poll_progress = poll_thin_merge_progress,
|
||||||
.finish_copy = lvconvert_merge_finish,
|
.finish_copy = lvconvert_merge_finish,
|
||||||
};
|
};
|
||||||
|
@ -19,30 +19,22 @@
|
|||||||
#include "polling_ops.h"
|
#include "polling_ops.h"
|
||||||
|
|
||||||
static struct poll_functions _pvmove_fns = {
|
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,
|
.poll_progress = poll_mirror_progress,
|
||||||
.update_metadata = pvmove_update_metadata,
|
.update_metadata = pvmove_update_metadata,
|
||||||
.finish_copy = pvmove_finish
|
.finish_copy = pvmove_finish
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct poll_functions _convert_fns = {
|
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,
|
.poll_progress = poll_mirror_progress,
|
||||||
.finish_copy = lvconvert_mirror_finish
|
.finish_copy = lvconvert_mirror_finish
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct poll_functions _merge_fns = {
|
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,
|
.poll_progress = poll_merge_progress,
|
||||||
.finish_copy = lvconvert_merge_finish
|
.finish_copy = lvconvert_merge_finish
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct poll_functions _thin_merge_fns = {
|
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,
|
.poll_progress = poll_thin_merge_progress,
|
||||||
.finish_copy = lvconvert_merge_finish
|
.finish_copy = lvconvert_merge_finish
|
||||||
};
|
};
|
||||||
|
@ -54,32 +54,6 @@ progress_t poll_mirror_progress(struct cmd_context *cmd,
|
|||||||
return PROGRESS_FINISHED_SEGMENT;
|
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,
|
static int _check_lv_status(struct cmd_context *cmd,
|
||||||
struct volume_group *vg,
|
struct volume_group *vg,
|
||||||
struct logical_volume *lv,
|
struct logical_volume *lv,
|
||||||
|
@ -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 = {
|
static struct poll_functions _pvmove_fns = {
|
||||||
.get_copy_name_from_lv = get_pvmove_pvname_from_lv_mirr,
|
.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,
|
.poll_progress = poll_mirror_progress,
|
||||||
.update_metadata = pvmove_update_metadata,
|
.update_metadata = pvmove_update_metadata,
|
||||||
.finish_copy = pvmove_finish,
|
.finish_copy = pvmove_finish,
|
||||||
|
Loading…
Reference in New Issue
Block a user