diff options
author | Alasdair Kergon <agk@redhat.com> | 2009-09-29 20:22:35 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2009-09-29 20:22:35 +0000 |
commit | 93bbc31c832868ec737b02f51f884f1825b0c1e7 (patch) | |
tree | a9fbc6cf94b7fe7e950f1c8f8113b6163e4a221c /tools | |
parent | 724de2791ef64af4622277745a61791757bec8ff (diff) | |
download | lvm2-93bbc31c832868ec737b02f51f884f1825b0c1e7.tar.gz lvm2-93bbc31c832868ec737b02f51f884f1825b0c1e7.tar.xz lvm2-93bbc31c832868ec737b02f51f884f1825b0c1e7.zip |
Don't attempt to restart pvmoves when deactivating LVs in vgchange.
Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lvchange.c | 14 | ||||
-rw-r--r-- | tools/toollib.c | 19 | ||||
-rw-r--r-- | tools/toollib.h | 3 | ||||
-rw-r--r-- | tools/vgchange.c | 10 |
4 files changed, 26 insertions, 20 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c index b9be0c2a..db22cadc 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -105,7 +105,6 @@ static int lvchange_availability(struct cmd_context *cmd, struct logical_volume *lv) { int activate; - const char *pvname; activate = arg_uint_value(cmd, available_ARG, 0); @@ -136,18 +135,7 @@ static int lvchange_availability(struct cmd_context *cmd, return_0; } - if ((lv->status & LOCKED) && - (pvname = get_pvmove_pvname_from_lv(lv))) { - log_verbose("Spawning background pvmove process for %s", - pvname); - pvmove_poll(cmd, pvname, 1); - } - - if (lv->status & CONVERTING) { - log_verbose("Spawning background lvconvert process for %s", - lv->name); - lvconvert_poll(cmd, lv, 1); - } + lv_spawn_background_polling(cmd, lv); } return 1; diff --git a/tools/toollib.c b/tools/toollib.c index afecaea8..ed38e188 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -1247,3 +1247,22 @@ int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg) return r; } + +void lv_spawn_background_polling(struct cmd_context *cmd, + struct logical_volume *lv) +{ + const char *pvname; + + if ((lv->status & LOCKED) && + (pvname = get_pvmove_pvname_from_lv(lv))) { + log_verbose("Spawning background pvmove process for %s", + pvname); + pvmove_poll(cmd, pvname, 1); + } + + if (lv->status & CONVERTING) { + log_verbose("Spawning background lvconvert process for %s", + lv->name); + lvconvert_poll(cmd, lv, 1); + } +} diff --git a/tools/toollib.h b/tools/toollib.h index 273cb65f..59cbeb6c 100644 --- a/tools/toollib.h +++ b/tools/toollib.h @@ -105,4 +105,7 @@ int fill_vg_create_params(struct cmd_context *cmd, int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv); int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg); +void lv_spawn_background_polling(struct cmd_context *cmd, + struct logical_volume *lv); + #endif diff --git a/tools/vgchange.c b/tools/vgchange.c index 95b0b48c..cef19c06 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -91,13 +91,9 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, } else if (!activate_lv(cmd, lv)) continue; - if ((lv->status & PVMOVE) && - (pvname = get_pvmove_pvname_from_lv_mirr(lv))) { - log_verbose("Spawning background process for %s %s", - lv->name, pvname); - pvmove_poll(cmd, pvname, 1); - continue; - } + if (activate != CHANGE_AN && activate != CHANGE_ALN && + (lv->status & (PVMOVE|CONVERTING))) + lv_spawn_background_polling(cmd, lv); count++; } |