1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: move _reload_lv()

Just move in front
This commit is contained in:
Zdenek Kabelac 2012-08-01 15:34:45 +02:00
parent 243cd3fd2c
commit 4698fb0543

View File

@ -492,6 +492,34 @@ static struct logical_volume *_get_lvconvert_lv(struct cmd_context *cmd __attrib
return lv;
}
static int _reload_lv(struct cmd_context *cmd, struct logical_volume *lv)
{
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
if (!vg_write(lv->vg))
return_0;
if (!suspend_lv(cmd, lv)) {
log_error("Failed to lock %s", lv->name);
vg_revert(lv->vg);
return 0;
}
if (!vg_commit(lv->vg)) {
if (!resume_lv(cmd, lv))
stack;
return_0;
}
log_very_verbose("Updating \"%s\" in kernel", lv->name);
if (!resume_lv(cmd, lv)) {
log_error("Problem reactivating %s", lv->name);
return 0;
}
return 1;
}
static int _finish_lvconvert_mirror(struct cmd_context *cmd,
struct volume_group *vg,
struct logical_volume *lv,
@ -1123,33 +1151,6 @@ static int _lvconvert_mirrors_parse_params(struct cmd_context *cmd,
return 1;
}
static int _reload_lv(struct cmd_context *cmd, struct logical_volume *lv)
{
log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
if (!vg_write(lv->vg))
return_0;
if (!suspend_lv(cmd, lv)) {
log_error("Failed to lock %s", lv->name);
vg_revert(lv->vg);
return 0;
}
if (!vg_commit(lv->vg)) {
if (!resume_lv(cmd, lv))
stack;
return_0;
}
log_very_verbose("Updating \"%s\" in kernel", lv->name);
if (!resume_lv(cmd, lv)) {
log_error("Problem reactivating %s", lv->name);
return 0;
}
return 1;
}
/*
* _lvconvert_mirrors_aux