summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-08-01 15:34:45 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-23 14:37:52 +0200
commit4698fb0543637761fc11af76643f6b8e81a631a9 (patch)
tree1d5184898c2318f1e2b9eb75de887d3c51cc2955
parent243cd3fd2ca377d93fd7407f2a0109a04a189cbc (diff)
downloadlvm2-4698fb0543637761fc11af76643f6b8e81a631a9.zip
lvm2-4698fb0543637761fc11af76643f6b8e81a631a9.tar.gz
lvm2-4698fb0543637761fc11af76643f6b8e81a631a9.tar.xz
lvconvert: move _reload_lv()
Just move in front
-rw-r--r--tools/lvconvert.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 76cc9b3..4c8dd50 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -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