mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvconvert: code cleanup and preps for refactoring
just a code cleanup and preparations for adding new code required for polldaemon refactoring. This commit should not have any functional impact.
This commit is contained in:
parent
32527861d0
commit
991d646354
@ -734,6 +734,7 @@ int lvconvert_poll(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
*/
|
||||
char uuid[sizeof(lv->lvid)];
|
||||
char lv_full_name[NAME_LEN];
|
||||
int is_thin, r;
|
||||
|
||||
if (dm_snprintf(lv_full_name, sizeof(lv_full_name), "%s/%s", lv->vg->name, lv->name) < 0) {
|
||||
log_error(INTERNAL_ERROR "Name \"%s/%s\" is too long.", lv->vg->name, lv->name);
|
||||
@ -742,14 +743,16 @@ int lvconvert_poll(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
|
||||
memcpy(uuid, &lv->lvid, sizeof(lv->lvid));
|
||||
|
||||
if (lv_is_merging_origin(lv))
|
||||
return poll_daemon(cmd, lv_full_name, uuid, background, 0,
|
||||
seg_is_thin_volume(find_snapshot(lv)) ?
|
||||
&_lvconvert_thin_merge_fns : &_lvconvert_merge_fns,
|
||||
"Merged");
|
||||
if (lv_is_merging_origin(lv)) {
|
||||
is_thin = seg_is_thin_volume(find_snapshot(lv));
|
||||
r = poll_daemon(cmd, lv_full_name, uuid, background, 0,
|
||||
is_thin ? &_lvconvert_thin_merge_fns : &_lvconvert_merge_fns,
|
||||
"Merged");
|
||||
} else
|
||||
r = poll_daemon(cmd, lv_full_name, uuid, background, 0,
|
||||
&_lvconvert_mirror_fns, "Converted");
|
||||
|
||||
return poll_daemon(cmd, lv_full_name, uuid, background, 0,
|
||||
&_lvconvert_mirror_fns, "Converted");
|
||||
return r;
|
||||
}
|
||||
|
||||
static int _insert_lvconvert_layer(struct cmd_context *cmd,
|
||||
|
Loading…
Reference in New Issue
Block a user